Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
VLC-Android
Manage
Activity
Members
Labels
Plan
Issues
528
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
082fb7ee
Commit
082fb7ee
authored
5 years ago
by
Geoffrey Métais
Browse files
Options
Downloads
Patches
Plain Diff
Storage: override refresh function to filter items
Fix
#897
parent
20d651ad
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Pipeline
#7516
passed with stage
in 3 minutes and 41 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
vlc-android/src/org/videolan/vlc/providers/BrowserProvider.kt
+2
-2
2 additions, 2 deletions
...android/src/org/videolan/vlc/providers/BrowserProvider.kt
vlc-android/src/org/videolan/vlc/providers/StorageProvider.kt
+16
-1
16 additions, 1 deletion
...android/src/org/videolan/vlc/providers/StorageProvider.kt
with
18 additions
and
3 deletions
vlc-android/src/org/videolan/vlc/providers/BrowserProvider.kt
+
2
−
2
View file @
082fb7ee
...
...
@@ -55,7 +55,7 @@ abstract class BrowserProvider(val context: Context, val dataset: LiveDataset<Me
protected
var
mediabrowser
:
MediaBrowser
?
=
null
private
val
foldersContentMap
=
SimpleArrayMap
<
MediaLibraryItem
,
MutableList
<
MediaLibraryItem
>>()
pr
ivate
lateinit
var
browserChannel
:
Channel
<
Media
>
pr
otected
lateinit
var
browserChannel
:
Channel
<
Media
>
private
val
showAll
=
Settings
.
getInstance
(
context
).
getBoolean
(
"browser_show_all_files"
,
true
)
val
descriptionUpdate
=
MutableLiveData
<
Pair
<
Int
,
String
>>()
...
...
@@ -249,7 +249,7 @@ abstract class BrowserProvider(val context: Context, val dataset: LiveDataset<Me
return
flags
}
pr
ivate
suspend
fun
requestBrowsing
(
url
:
String
?)
=
withContext
(
Dispatchers
.
IO
)
{
pr
otected
suspend
fun
requestBrowsing
(
url
:
String
?)
=
withContext
(
Dispatchers
.
IO
)
{
initBrowser
()
mediabrowser
?.
let
{
if
(
url
!=
null
)
it
.
browse
(
Uri
.
parse
(
url
),
getFlags
())
...
...
This diff is collapsed.
Click to expand it.
vlc-android/src/org/videolan/vlc/providers/StorageProvider.kt
+
16
−
1
View file @
082fb7ee
...
...
@@ -23,6 +23,10 @@ package org.videolan.vlc.providers
import
android.content.Context
import
android.net.Uri
import
android.text.TextUtils
import
kotlinx.coroutines.channels.Channel
import
kotlinx.coroutines.channels.filter
import
kotlinx.coroutines.channels.mapTo
import
org.videolan.libvlc.Media
import
org.videolan.medialibrary.media.MediaLibraryItem
import
org.videolan.medialibrary.media.MediaWrapper
import
org.videolan.medialibrary.media.Storage
...
...
@@ -66,4 +70,15 @@ class StorageProvider(context: Context, dataset: LiveDataset<MediaLibraryItem>,
}
else
if
(
media
.
itemType
!=
MediaLibraryItem
.
TYPE_STORAGE
)
return
super
.
addMedia
(
media
)
}
}
\ No newline at end of file
override
suspend
fun
refreshImpl
()
{
browserChannel
=
Channel
(
Channel
.
UNLIMITED
)
requestBrowsing
(
url
)
val
value
:
MutableList
<
MediaLibraryItem
>
=
browserChannel
.
filter
{
it
.
isStorage
()
}.
mapTo
(
mutableListOf
())
{
Storage
(
it
.
uri
)}
dataset
.
value
=
value
parseSubDirectories
()
loading
.
value
=
false
}
}
private
fun
Media
.
isStorage
()
=
type
==
Media
.
Type
.
Directory
This diff is collapsed.
Click to expand it.
Geoffrey Métais
@Dekans
mentioned in commit
0655ce54
·
5 years ago
mentioned in commit
0655ce54
mentioned in commit 0655ce5407aac6cd30e9ea2fa4c418234b9a6f58
Toggle commit list
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