Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
VLC-Android
Manage
Activity
Members
Labels
Plan
Issues
531
Issue boards
Milestones
Wiki
Code
Merge requests
14
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
VideoLAN
VLC-Android
Commits
2ae2fc93
Commit
2ae2fc93
authored
6 years ago
by
Geoffrey Métais
Browse files
Options
Downloads
Patches
Plain Diff
Fix state for loadlastplaylist
parent
4cabb3ad
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
vlc-android/src/org/videolan/vlc/media/PlaylistManager.kt
+12
-3
12 additions, 3 deletions
vlc-android/src/org/videolan/vlc/media/PlaylistManager.kt
with
12 additions
and
3 deletions
vlc-android/src/org/videolan/vlc/media/PlaylistManager.kt
+
12
−
3
View file @
2ae2fc93
...
...
@@ -8,8 +8,11 @@ import android.support.v7.preference.PreferenceManager
import
android.text.TextUtils
import
android.util.Log
import
android.widget.Toast
import
kotlinx.coroutines.experimental.*
import
kotlinx.coroutines.experimental.CommonPool
import
kotlinx.coroutines.experimental.CoroutineStart
import
kotlinx.coroutines.experimental.android.UI
import
kotlinx.coroutines.experimental.launch
import
kotlinx.coroutines.experimental.withContext
import
org.videolan.libvlc.Media
import
org.videolan.libvlc.MediaPlayer
import
org.videolan.medialibrary.Medialibrary
...
...
@@ -116,9 +119,15 @@ class PlaylistManager(val service: PlaybackService) : MediaWrapperList.EventList
loadingLastPlaylist
=
true
val
audio
=
type
==
Constants
.
PLAYLIST_TYPE_AUDIO
val
currentMedia
=
settings
.
getString
(
if
(
audio
)
"current_song"
else
"current_media"
,
""
)
if
(
""
==
currentMedia
)
return
false
if
(
""
==
currentMedia
)
{
loadingLastPlaylist
=
false
return
false
}
val
locations
=
settings
.
getString
(
if
(
audio
)
"audio_list"
else
"media_list"
,
""
).
split
(
" "
.
toRegex
()).
dropLastWhile
({
it
.
isEmpty
()
}).
toTypedArray
()
if
(
Util
.
isArrayEmpty
(
locations
))
return
false
if
(
Util
.
isArrayEmpty
(
locations
))
{
loadingLastPlaylist
=
false
return
false
}
launch
(
UI
,
CoroutineStart
.
UNDISPATCHED
)
{
val
playList
=
withContext
(
CommonPool
)
{
locations
.
map
{
Uri
.
decode
(
it
)
}.
mapTo
(
ArrayList
(
locations
.
size
))
{
MediaWrapper
(
Uri
.
parse
(
it
))
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment