From b0987f1ad97c7527c05909d006be1b19c51b35cf Mon Sep 17 00:00:00 2001 From: Hai Zhang Date: Fri, 15 Sep 2023 02:57:06 -0700 Subject: [PATCH] [Fix] Make supportsThumbnail support media for remote providers as well. Bug: #683 --- .../me/zhanghai/android/files/filelist/FileItemExtensions.kt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/me/zhanghai/android/files/filelist/FileItemExtensions.kt b/app/src/main/java/me/zhanghai/android/files/filelist/FileItemExtensions.kt index 374ee7382..1be1a109e 100644 --- a/app/src/main/java/me/zhanghai/android/files/filelist/FileItemExtensions.kt +++ b/app/src/main/java/me/zhanghai/android/files/filelist/FileItemExtensions.kt @@ -26,6 +26,7 @@ import me.zhanghai.android.files.provider.linux.isLinuxPath import me.zhanghai.android.files.settings.Settings import me.zhanghai.android.files.util.asFileName import me.zhanghai.android.files.util.isGetPackageArchiveInfoCompatible +import me.zhanghai.android.files.util.isMediaMetadataRetrieverCompatible import me.zhanghai.android.files.util.valueCompat import java.text.CollationKey @@ -70,7 +71,7 @@ val FileItem.supportsThumbnail: Boolean return when { mimeType.isApk && path.isGetPackageArchiveInfoCompatible -> true mimeType.isImage -> true - mimeType.isMedia && (path.isLinuxPath || path.isDocumentPath) -> true + mimeType.isMedia && path.isMediaMetadataRetrieverCompatible -> true mimeType.isPdf && (path.isLinuxPath || path.isDocumentPath) -> Build.VERSION.SDK_INT >= Build.VERSION_CODES.P || Settings.SHOW_PDF_THUMBNAIL_PRE_28.valueCompat