[Android] MediaParsingService fix logic fail
Geoffrey Métais
git at videolan.org
Wed Aug 1 10:30:01 CEST 2018
vlc-android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Tue Jul 31 17:41:31 2018 +0200| [3d6c12118d97b435c715e039141adabeb9ce17d5] | committer: Geoffrey Métais
MediaParsingService fix logic fail
> https://code.videolan.org/videolan/vlc-android/commit/3d6c12118d97b435c715e039141adabeb9ce17d5
---
vlc-android/src/org/videolan/vlc/MediaParsingService.kt | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/vlc-android/src/org/videolan/vlc/MediaParsingService.kt b/vlc-android/src/org/videolan/vlc/MediaParsingService.kt
index d061ba730..5c818b55f 100644
--- a/vlc-android/src/org/videolan/vlc/MediaParsingService.kt
+++ b/vlc-android/src/org/videolan/vlc/MediaParsingService.kt
@@ -208,7 +208,7 @@ class MediaParsingService : Service(), DevicesDiscoveryCb {
val isMainStorage = TextUtils.equals(device, AndroidDevices.EXTERNAL_PUBLIC_DIRECTORY)
val uuid = FileUtils.getFileNameFromPath(device)
if (TextUtils.isEmpty(device) || TextUtils.isEmpty(uuid)) continue
- val isNew = isMainStorage && (addExternal && withContext(VLCIO) { File(device).canRead() } )
+ val isNew = (isMainStorage || (addExternal && withContext(VLCIO) { File(device).canRead() } ))
&& medialibrary.addDevice(if (isMainStorage) "main-storage" else uuid, device, !isMainStorage)
val isIgnored = sharedPreferences.getBoolean("ignore_$uuid", false)
if (!isMainStorage && isNew && !isIgnored) showStorageNotification(device)
More information about the Android
mailing list