[Android] Revert "Ml: fix discovery-failure after onboarding skip"
Duncan McNamara
git at videolan.org
Tue Jan 24 12:47:14 UTC 2023
vlc-android | branch: 3.5.x | Duncan McNamara <dcn.mcnamara at gmail.com> | Tue Jan 24 13:20:42 2023 +0100| [cdab9b5009c450c712a7b8e952d69cceece1f512] | committer: Nicolas Pomepuy
Revert "Ml: fix discovery-failure after onboarding skip"
This reverts commit 2338bd92a00c8e9ce00109cca5f3bb56f37b4e38.
This commit causes medialibrary in sdcard to be dropped as it permits
the addition of folders as ML devices, which is not what they are.
This causes the medialibrary remove these "devices" when
updatingDevices, hence removing the selected folders.
Fixes #2791
(cherry picked from commit b2e0b54eaf43e3c7e50bfee28514652778ba8bfd)
> https://code.videolan.org/videolan/vlc-android/commit/cdab9b5009c450c712a7b8e952d69cceece1f512
---
.../vlc-android/src/org/videolan/vlc/MediaParsingService.kt | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/application/vlc-android/src/org/videolan/vlc/MediaParsingService.kt b/application/vlc-android/src/org/videolan/vlc/MediaParsingService.kt
index 5cb306315b..6d6a6d8925 100644
--- a/application/vlc-android/src/org/videolan/vlc/MediaParsingService.kt
+++ b/application/vlc-android/src/org/videolan/vlc/MediaParsingService.kt
@@ -226,12 +226,9 @@ class MediaParsingService : LifecycleService(), DevicesDiscoveryCb {
return
}
}
- val isMainStorage = path.removeFileScheme().startsWith(AndroidDevices.EXTERNAL_PUBLIC_DIRECTORY)
- if (isMainStorage) {
- medialibrary.addDevice("main-storage", path, false)
- } else if (AndroidDevices.externalStorageDirectories.isNotEmpty()) {
+ if (AndroidDevices.externalStorageDirectories.isNotEmpty()) {
for (storagePath in AndroidDevices.externalStorageDirectories) {
- if (path.removeFileScheme().startsWith(storagePath)) {
+ if (path.startsWith(storagePath)) {
val uuid = FileUtils.getFileNameFromPath(path)
if (uuid.isEmpty()) {
exitCommand()
@@ -243,6 +240,9 @@ class MediaParsingService : LifecycleService(), DevicesDiscoveryCb {
}
}
}
+ } else {
+ val uuid = FileUtils.getFileNameFromPath(path)
+ medialibrary.addDevice(uuid, path, false)
}
}
More information about the Android
mailing list