Skip to content
Snippets Groups Projects
Commit 238a9bfe authored by Geoffrey Métais's avatar Geoffrey Métais
Browse files

Check ML is started instead of initialized

parent 8d6e0286
No related branches found
No related tags found
No related merge requests found
......@@ -408,7 +408,7 @@ fun reload(ctx: Context) {
}
fun Context.startMedialibrary(firstRun: Boolean = false, upgrade: Boolean = false, parse: Boolean = true) = uiJob {
if (Medialibrary.getInstance().isInitiated || !Permissions.canReadStorage(this@startMedialibrary)) return@uiJob
if (Medialibrary.getInstance().isStarted || !Permissions.canReadStorage(this@startMedialibrary)) return@uiJob
val prefs = withContext(VLCIO) { VLCApplication.getSettings() ?: android.preference.PreferenceManager.getDefaultSharedPreferences(this@startMedialibrary) }
val scanOpt = if (VLCApplication.showTvUi()) Constants.ML_SCAN_ON else prefs.getInt(Constants.KEY_MEDIALIBRARY_SCAN, -1)
if (parse && scanOpt == -1) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment