[Android] Add device if needed on folder discover request
Geoffrey Métais
git at videolan.org
Thu May 11 16:53:35 CEST 2017
vlc-android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Thu May 11 15:08:05 2017 +0200| [d36e58665c91e56eaef7d1fc8f88346d1eb49419] | committer: Geoffrey Métais
Add device if needed on folder discover request
> https://code.videolan.org/videolan/vlc-android/commit/d36e58665c91e56eaef7d1fc8f88346d1eb49419
---
vlc-android/src/org/videolan/vlc/MediaParsingService.java | 3 +++
1 file changed, 3 insertions(+)
diff --git a/vlc-android/src/org/videolan/vlc/MediaParsingService.java b/vlc-android/src/org/videolan/vlc/MediaParsingService.java
index e7b4403..c487c95 100644
--- a/vlc-android/src/org/videolan/vlc/MediaParsingService.java
+++ b/vlc-android/src/org/videolan/vlc/MediaParsingService.java
@@ -149,6 +149,7 @@ public class MediaParsingService extends Service implements DevicesDiscoveryCb {
mThreadPool.execute(new Runnable() {
@Override
public void run() {
+ addDeviceIfNeeded(path);
mMedialibrary.discover(path);
}
});
@@ -162,6 +163,8 @@ public class MediaParsingService extends Service implements DevicesDiscoveryCb {
for (String storagePath : AndroidDevices.getExternalStorageDirectories()) {
if (path.startsWith(storagePath)) {
String uuid = FileUtils.getFileNameFromPath(path);
+ if (TextUtils.isEmpty(uuid))
+ uuid = "root";
mMedialibrary.addDevice(uuid, path, true);
}
}
More information about the Android
mailing list