[Android] More consistent tracks sorting from artists

Geoffrey Métais git at videolan.org
Wed Jan 9 09:45:24 CET 2019


vlc-android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Wed Jan  9 09:44:44 2019 +0100| [e64155217cfb88e8c88bb70a1489e7d826eff6d0] | committer: Geoffrey Métais

More consistent tracks sorting from artists

> https://code.videolan.org/videolan/vlc-android/commit/e64155217cfb88e8c88bb70a1489e7d826eff6d0
---

 medialibrary/src/org/videolan/medialibrary/media/Album.java           | 2 +-
 medialibrary/src/org/videolan/medialibrary/media/Artist.java          | 2 +-
 medialibrary/src/org/videolan/medialibrary/media/Genre.java           | 2 +-
 vlc-android/src/org/videolan/vlc/viewmodels/paged/PagedTracksModel.kt | 2 +-
 4 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/medialibrary/src/org/videolan/medialibrary/media/Album.java b/medialibrary/src/org/videolan/medialibrary/media/Album.java
index 97574e8a3..326d14263 100644
--- a/medialibrary/src/org/videolan/medialibrary/media/Album.java
+++ b/medialibrary/src/org/videolan/medialibrary/media/Album.java
@@ -74,7 +74,7 @@ public class Album extends MediaLibraryItem {
     }
 
     public MediaWrapper[] getTracks() {
-        return getTracks(Medialibrary.SORT_DEFAULT, false);
+        return getTracks(Medialibrary.SORT_ALBUM, false);
     }
 
     public MediaWrapper[] getTracks(int sort, boolean desc) {
diff --git a/medialibrary/src/org/videolan/medialibrary/media/Artist.java b/medialibrary/src/org/videolan/medialibrary/media/Artist.java
index 533716cf7..b21a4642e 100644
--- a/medialibrary/src/org/videolan/medialibrary/media/Artist.java
+++ b/medialibrary/src/org/videolan/medialibrary/media/Artist.java
@@ -94,7 +94,7 @@ public class Artist extends MediaLibraryItem {
     }
 
     public MediaWrapper[] getTracks() {
-        return getTracks(Medialibrary.SORT_ALBUM, false);
+        return getTracks(Medialibrary.SORT_ALBUM, true);
     }
 
     public MediaWrapper[] getTracks(int sort, boolean desc) {
diff --git a/medialibrary/src/org/videolan/medialibrary/media/Genre.java b/medialibrary/src/org/videolan/medialibrary/media/Genre.java
index e075e4c47..2b79c424d 100644
--- a/medialibrary/src/org/videolan/medialibrary/media/Genre.java
+++ b/medialibrary/src/org/videolan/medialibrary/media/Genre.java
@@ -39,7 +39,7 @@ public class Genre extends MediaLibraryItem {
     }
 
     public MediaWrapper[] getTracks() {
-        return getTracks(Medialibrary.SORT_DEFAULT, false);
+        return getTracks(Medialibrary.SORT_ALBUM, false);
     }
 
     public MediaWrapper[] getTracks(int sort, boolean desc) {
diff --git a/vlc-android/src/org/videolan/vlc/viewmodels/paged/PagedTracksModel.kt b/vlc-android/src/org/videolan/vlc/viewmodels/paged/PagedTracksModel.kt
index 3d2c5a0bb..74f9c9cfa 100644
--- a/vlc-android/src/org/videolan/vlc/viewmodels/paged/PagedTracksModel.kt
+++ b/vlc-android/src/org/videolan/vlc/viewmodels/paged/PagedTracksModel.kt
@@ -24,7 +24,7 @@ class PagedTracksModel(context: Context, val parent: MediaLibraryItem? = null):
 
     init {
         sort = Settings.getInstance(context).getInt(sortKey, Medialibrary.SORT_ALPHA)
-        desc = Settings.getInstance(context).getBoolean("${sortKey}_desc", false)
+        desc = Settings.getInstance(context).getBoolean("${sortKey}_desc", parent is Artist)
         if (sort == Medialibrary.SORT_ALPHA) sort = when (parent) {
             is Artist -> Medialibrary.SORT_ALBUM
             is Album -> Medialibrary.SORT_DEFAULT



More information about the Android mailing list