[Android] LoadLastPlaylist: Fix logic fail
Geoffrey Métais
git at videolan.org
Wed Oct 10 11:48:12 CEST 2018
vlc-android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Wed Oct 10 11:47:41 2018 +0200| [3525cabbb11062a5f456ad1f1a265d6b4a13fccc] | committer: Geoffrey Métais
LoadLastPlaylist: Fix logic fail
> https://code.videolan.org/videolan/vlc-android/commit/3525cabbb11062a5f456ad1f1a265d6b4a13fccc
---
vlc-android/src/org/videolan/vlc/media/PlaylistManager.kt | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/vlc-android/src/org/videolan/vlc/media/PlaylistManager.kt b/vlc-android/src/org/videolan/vlc/media/PlaylistManager.kt
index aeb4e81c0..bbd46a6f2 100644
--- a/vlc-android/src/org/videolan/vlc/media/PlaylistManager.kt
+++ b/vlc-android/src/org/videolan/vlc/media/PlaylistManager.kt
@@ -10,7 +10,6 @@ import android.text.TextUtils
import android.util.Log
import android.widget.Toast
import kotlinx.coroutines.experimental.*
-import kotlinx.coroutines.experimental.android.Main
import org.videolan.libvlc.Media
import org.videolan.libvlc.MediaPlayer
import org.videolan.libvlc.RendererItem
@@ -136,7 +135,7 @@ class PlaylistManager(val service: PlaybackService) : MediaWrapperList.EventList
return false
}
val locations = settings.getString(if (audio) "audio_list" else "media_list", null)?.split(" ".toRegex())?.dropLastWhile({ it.isEmpty() })?.toTypedArray()
- if (locations?.isNotEmpty() != false) {
+ if (locations?.isNotEmpty() != true) {
loadingLastPlaylist = false
return false
}
@@ -446,7 +445,7 @@ class PlaylistManager(val service: PlaybackService) : MediaWrapperList.EventList
for (mw in mediaList.all) locations.append(" ").append(Uri.encode(Uri.decode(mw.uri.toString())))
//We save a concatenated String because putStringSet is APIv11.
settings.edit()
- .putString(if (!isAudioList()) "media_list" else "audio_list", locations.toString().trim { it <= ' ' })
+ .putString(if (isAudioList()) "audio_list" else "media_list", locations.toString().trim())
.apply()
}
More information about the Android
mailing list