|
48 | 48 | import at.kc.tugraz.ss.service.userevent.datatypes.pars.SSUEAddPar; |
49 | 49 | import at.kc.tugraz.ss.service.userevent.datatypes.pars.SSUEsGetPar; |
50 | 50 | import at.tugraz.sss.serv.SSEntity; |
| 51 | +import at.tugraz.sss.serv.SSFileExtE; |
51 | 52 | import at.tugraz.sss.serv.SSLogU; |
| 53 | +import at.tugraz.sss.serv.SSMimeTypeE; |
52 | 54 | import at.tugraz.sss.serv.SSServErrReg; |
53 | 55 | import at.tugraz.sss.serv.SSServReg; |
54 | 56 | import com.evernote.edam.type.LinkedNotebook; |
@@ -670,30 +672,31 @@ private void handleResources() throws Exception{ |
670 | 672 |
|
671 | 673 | resourceWithContent = SSServCaller.evernoteResourceGet (evernoteInfo.noteStore, resource.getGuid(), false); |
672 | 674 |
|
673 | | -// if(resourceWithContent.getAttributes().isSetSourceURL()){ |
674 | | -// SSLogU.info(resourceWithContent.getAttributes().getSourceURL()); |
675 | | -// continue; |
676 | | -// } |
677 | | -// |
678 | | -// if( |
679 | | -// !resourceWithContent.isSetHeight() || |
680 | | -// !resourceWithContent.isSetWidth()){ |
681 | | -// |
682 | | -// SSLogU.info("evernote resource height or width not set"); |
683 | | -// continue; |
684 | | -// } |
685 | | - |
686 | | - if( |
687 | | - resourceWithContent.isSetHeight() && |
688 | | - resourceWithContent.isSetWidth()){ |
689 | | - |
690 | | - if( |
691 | | - resourceWithContent.getWidth() <= 250|| |
692 | | - resourceWithContent.getHeight() <= 250){ |
693 | | - |
694 | | - SSLogU.info("evernote resource height or width < 250"); |
695 | | - continue; |
696 | | - } |
| 675 | + try{ |
| 676 | + if(SSFileExtE.isImageFileExt(SSMimeTypeE.fileExtForMimeType1(resourceWithContent.getMime()))){ |
| 677 | + |
| 678 | + if(resourceWithContent.getAttributes().isSetSourceURL()){ |
| 679 | + SSLogU.info("evernote image with source url ignored: " + resourceWithContent.getAttributes().getSourceURL()); |
| 680 | + continue; |
| 681 | + } |
| 682 | + |
| 683 | + if( |
| 684 | + !resourceWithContent.isSetHeight() || |
| 685 | + !resourceWithContent.isSetWidth()){ |
| 686 | + |
| 687 | + SSLogU.info("evernote image resource height or width not set"); |
| 688 | + continue; |
| 689 | + } |
| 690 | + |
| 691 | + if( |
| 692 | + resourceWithContent.getWidth() <= 250|| |
| 693 | + resourceWithContent.getHeight() <= 250){ |
| 694 | + |
| 695 | + SSLogU.info("evernote image resource height or width < 250"); |
| 696 | + continue; |
| 697 | + } |
| 698 | + } |
| 699 | + }catch(Exception error){ |
697 | 700 | } |
698 | 701 |
|
699 | 702 | resourceWithContent = SSServCaller.evernoteResourceGet (evernoteInfo.noteStore, resource.getGuid(), true); |
@@ -909,11 +912,6 @@ private Boolean addCurrentlyRunEvernoteImport( |
909 | 912 |
|
910 | 913 | try{ |
911 | 914 |
|
912 | | - if(currentlyRunEvernoteImportsLock.isWriteLocked()){ |
913 | | - SSLogU.warn("attempted to start B&P evernote import concurrently for " + authEmail); |
914 | | - return false; |
915 | | - } |
916 | | - |
917 | 915 | if(!currentlyRunEvernoteImportsLock.isWriteLockedByCurrentThread()){ |
918 | 916 | currentlyRunEvernoteImportsLock.writeLock().lock(); |
919 | 917 | } |
|
0 commit comments