[Android] Restore progressive browsing
Geoffrey Métais
git at videolan.org
Wed Aug 8 17:19:09 CEST 2018
vlc-android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Wed Aug 8 17:18:47 2018 +0200| [d4bbac97c3c4416dcb7da79648252b4544128c9e] | committer: Geoffrey Métais
Restore progressive browsing
> https://code.videolan.org/videolan/vlc-android/commit/d4bbac97c3c4416dcb7da79648252b4544128c9e
---
vlc-android/src/org/videolan/vlc/providers/BrowserProvider.kt | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/vlc-android/src/org/videolan/vlc/providers/BrowserProvider.kt b/vlc-android/src/org/videolan/vlc/providers/BrowserProvider.kt
index c0ee354e7..ae9b25899 100644
--- a/vlc-android/src/org/videolan/vlc/providers/BrowserProvider.kt
+++ b/vlc-android/src/org/videolan/vlc/providers/BrowserProvider.kt
@@ -88,7 +88,7 @@ abstract class BrowserProvider(val context: Context, val dataset: LiveDataset<Me
browserChannel = Channel(Channel.UNLIMITED)
requestBrowsing(url)
job = launch(UI.immediate) {
- dataset.value = browserChannel.mapTo(mutableListOf()) { findMedia(it) }
+ for (media in browserChannel) addMedia(findMedia(media))
parseSubDirectories()
}
}
@@ -97,7 +97,12 @@ abstract class BrowserProvider(val context: Context, val dataset: LiveDataset<Me
open fun refresh(): Boolean {
if (url === null) return false
- browse()
+ browserChannel = Channel(Channel.UNLIMITED)
+ requestBrowsing(url)
+ job = launch(UI.immediate) {
+ dataset.value = browserChannel.mapTo(mutableListOf()) { findMedia(it) }
+ parseSubDirectories()
+ }
return true
}
More information about the Android
mailing list