[Android] Reload library instead of force rescan
Geoffrey Métais
git at videolan.org
Thu Aug 8 11:06:39 CEST 2019
vlc-android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Thu Aug 8 10:15:05 2019 +0200| [9dd19a6060ac1a6a05ab9ea46e84f00ce2e3a7e3] | committer: Geoffrey Métais
Reload library instead of force rescan
Fixes #932
> https://code.videolan.org/videolan/vlc-android/commit/9dd19a6060ac1a6a05ab9ea46e84f00ce2e3a7e3
---
vlc-android/src/org/videolan/vlc/gui/MainActivity.kt | 7 +++++--
vlc-android/src/org/videolan/vlc/gui/SecondaryActivity.kt | 4 +---
2 files changed, 6 insertions(+), 5 deletions(-)
diff --git a/vlc-android/src/org/videolan/vlc/gui/MainActivity.kt b/vlc-android/src/org/videolan/vlc/gui/MainActivity.kt
index 79019cb15..f88a76460 100644
--- a/vlc-android/src/org/videolan/vlc/gui/MainActivity.kt
+++ b/vlc-android/src/org/videolan/vlc/gui/MainActivity.kt
@@ -36,7 +36,9 @@ import kotlinx.coroutines.ExperimentalCoroutinesApi
import kotlinx.coroutines.ObsoleteCoroutinesApi
import org.videolan.libvlc.util.AndroidUtil
import org.videolan.medialibrary.interfaces.AbstractMedialibrary
-import org.videolan.vlc.*
+import org.videolan.vlc.BuildConfig
+import org.videolan.vlc.R
+import org.videolan.vlc.StartActivity
import org.videolan.vlc.extensions.ExtensionManagerService
import org.videolan.vlc.extensions.ExtensionsManager
import org.videolan.vlc.gui.audio.AudioBrowserFragment
@@ -49,6 +51,7 @@ import org.videolan.vlc.gui.video.VideoGridFragment
import org.videolan.vlc.interfaces.Filterable
import org.videolan.vlc.interfaces.IRefreshable
import org.videolan.vlc.media.MediaUtils
+import org.videolan.vlc.reloadLibrary
import org.videolan.vlc.util.*
private const val TAG = "VLC/MainActivity"
@@ -201,7 +204,7 @@ class MainActivity : ContentActivity(),
if (current != null && current is IRefreshable)
(current as IRefreshable).refresh()
else
- this.rescan()
+ reloadLibrary()
}
}
diff --git a/vlc-android/src/org/videolan/vlc/gui/SecondaryActivity.kt b/vlc-android/src/org/videolan/vlc/gui/SecondaryActivity.kt
index cc1226881..4bf81d73a 100644
--- a/vlc-android/src/org/videolan/vlc/gui/SecondaryActivity.kt
+++ b/vlc-android/src/org/videolan/vlc/gui/SecondaryActivity.kt
@@ -35,7 +35,6 @@ import kotlinx.coroutines.ExperimentalCoroutinesApi
import kotlinx.coroutines.ObsoleteCoroutinesApi
import org.videolan.medialibrary.interfaces.AbstractMedialibrary
import org.videolan.vlc.R
-import org.videolan.vlc.VLCApplication
import org.videolan.vlc.gui.audio.AudioAlbumsSongsFragment
import org.videolan.vlc.gui.audio.AudioBrowserFragment
import org.videolan.vlc.gui.browser.StorageBrowserFragment
@@ -43,7 +42,6 @@ import org.videolan.vlc.gui.helpers.UiTools
import org.videolan.vlc.gui.tv.TvUtil
import org.videolan.vlc.gui.video.VideoGridFragment
import org.videolan.vlc.reloadLibrary
-import org.videolan.vlc.rescan
import org.videolan.vlc.util.AndroidDevices
import org.videolan.vlc.util.KEY_FOLDER
import org.videolan.vlc.util.RESULT_RESCAN
@@ -107,7 +105,7 @@ class SecondaryActivity : ContentActivity() {
when (item.itemId) {
R.id.ml_menu_refresh -> {
val ml = AbstractMedialibrary.getInstance()
- if (!ml.isWorking) this.rescan()
+ if (!ml.isWorking) reloadLibrary()
return true
}
}
More information about the Android
mailing list