File tree Expand file tree Collapse file tree
app/src/main/java/com/owncloud/android Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -578,6 +578,9 @@ private Bitmap doThumbnailFromOCFileInBackground() {
578578 String imageKey = PREFIX_THUMBNAIL + file .getRemoteId ();
579579
580580 boolean updateEnforced = (file instanceof OCFile && ((OCFile ) file ).isUpdateThumbnailNeeded ());
581+ if (MimeTypeUtil .isZip (file )) {
582+ return null ;
583+ }
581584
582585 // Try to load thumbnail from disk cache
583586 if (!updateEnforced ) {
Original file line number Diff line number Diff line change @@ -330,6 +330,27 @@ public static boolean isPDF(OCFile file) {
330330 return isPDF (file .getMimeType ()) || isPDF (getMimeTypeFromPath (file .getRemotePath ()));
331331 }
332332
333+ public static boolean isZip (String mimeType ) {
334+ if (mimeType == null ) {
335+ return false ;
336+ }
337+ String lower = mimeType .toLowerCase (Locale .ROOT );
338+ return lower .equals ("application/zip" )
339+ || lower .equals ("application/x-7z-compressed" )
340+ || lower .equals ("application/x-bzip2" )
341+ || lower .equals ("application/x-compressed" )
342+ || lower .equals ("application/x-deb" )
343+ || lower .equals ("application/gzip" )
344+ || lower .equals ("application/x-gzip" )
345+ || lower .equals ("application/x-rar-compressed" )
346+ || lower .equals ("application/x-tar" )
347+ || lower .equals ("application/vnd.android.package-archive" );
348+ }
349+
350+ public static boolean isZip (ServerFileInterface file ) {
351+ return isZip (file .getMimeType ());
352+ }
353+
333354 /**
334355 * Extracts the mime type for the given file.
335356 *
You can’t perform that action at this time.
0 commit comments