File tree Expand file tree Collapse file tree 1 file changed +6
-0
lines changed
app/src/main/kotlin/org/akanework/gramophone/ui/adapters Expand file tree Collapse file tree 1 file changed +6
-0
lines changed Original file line number Diff line number Diff line change @@ -25,6 +25,7 @@ import androidx.appcompat.app.AlertDialog
2525import androidx.appcompat.widget.PopupMenu
2626import androidx.core.app.ShareCompat
2727import androidx.core.content.FileProvider
28+ import androidx.core.net.toFile
2829import androidx.fragment.app.Fragment
2930import androidx.fragment.app.activityViewModels
3031import androidx.media3.common.C
@@ -319,13 +320,18 @@ class SongAdapter(
319320 Sorter .Type .ByAddDateDescending , Sorter .Type .ByAddDateAscending ,
320321 Sorter .Type .ByReleaseDateDescending , Sorter .Type .ByReleaseDateAscending ,
321322 Sorter .Type .ByModifiedDateDescending , Sorter .Type .ByModifiedDateAscending ,
323+ Sorter .Type .ByFilePathDescending , Sorter .Type .ByFilePathAscending ,
322324 Sorter .Type .ByDiscAndTrack
323325 )
324326 ) : Sorter.Helper<MediaItem>(types) {
325327 override fun getId (item : MediaItem ): String {
326328 return item.mediaId
327329 }
328330
331+ override fun getFile (item : MediaItem ): File {
332+ return item.localConfiguration!! .uri.toFile()
333+ }
334+
329335 override fun getTitle (item : MediaItem ): String {
330336 return item.mediaMetadata.title.toString()
331337 }
You can’t perform that action at this time.
0 commit comments