Browse Source

fix for media tab not showing thumbnails when image is on server only and not in the cache manager.

Signed-off-by: camillo-positano <camillo.positano@hotmail.it>
camillo-positano 11 tháng trước cách đây
mục cha
commit
8d6a099770

+ 2 - 2
app/src/main/java/com/owncloud/android/datamodel/ThumbnailsCacheManager.java

@@ -289,7 +289,7 @@ public final class ThumbnailsCacheManager {
             file = (OCFile) params[0];
 
 
-            if (file.getRemoteId() != null && file.isPreviewAvailable()) {
+            if (file.getRemoteId() != null || file.isPreviewAvailable()) {
                 // Thumbnail in cache?
                 thumbnail = ThumbnailsCacheManager.getBitmapFromDiskCache(
                     ThumbnailsCacheManager.PREFIX_RESIZED_IMAGE + file.getRemoteId()
@@ -1423,7 +1423,7 @@ public final class ThumbnailsCacheManager {
                 }
             }
 
-            // resized dimensions
+            // resized dimensions and set update thumbnail needed to false to prevent rendering loop
             if (thumbnail != null) {
                 file.setImageDimension(new ImageDimension(thumbnail.getWidth(), thumbnail.getHeight()));
                 storageManager.saveFile(file);