aboutsummaryrefslogtreecommitdiff
path: root/app/src
diff options
context:
space:
mode:
authorScott Jackson <daneren2005@gmail.com>2015-12-14 18:05:25 -0800
committerScott Jackson <daneren2005@gmail.com>2015-12-14 18:05:25 -0800
commit1eca3c26de2d6bc3cb3b55d44cec39c94a08ac3b (patch)
tree623e2ee057b69a352844ef149c0a167c5b54dc2b /app/src
parente22398a16d6c55f820fc8244b04dc868859435a6 (diff)
downloaddsub-1eca3c26de2d6bc3cb3b55d44cec39c94a08ac3b.tar.gz
dsub-1eca3c26de2d6bc3cb3b55d44cec39c94a08ac3b.tar.bz2
dsub-1eca3c26de2d6bc3cb3b55d44cec39c94a08ac3b.zip
Sort artists on every view since second level artists are otherwise not sorted the same way
Diffstat (limited to 'app/src')
-rw-r--r--app/src/main/java/github/daneren2005/dsub/fragments/SelectArtistFragment.java4
-rw-r--r--app/src/main/java/github/daneren2005/dsub/service/CachedMusicService.java2
-rw-r--r--app/src/main/java/github/daneren2005/dsub/service/OfflineMusicService.java1
3 files changed, 4 insertions, 3 deletions
diff --git a/app/src/main/java/github/daneren2005/dsub/fragments/SelectArtistFragment.java b/app/src/main/java/github/daneren2005/dsub/fragments/SelectArtistFragment.java
index 9f1a62f8..3df0a9a9 100644
--- a/app/src/main/java/github/daneren2005/dsub/fragments/SelectArtistFragment.java
+++ b/app/src/main/java/github/daneren2005/dsub/fragments/SelectArtistFragment.java
@@ -177,6 +177,7 @@ public class SelectArtistFragment extends SelectRecyclerFragment<Artist> impleme
String musicFolderId = Util.getSelectedMusicFolderId(context);
Indexes indexes = musicService.getIndexes(musicFolderId, refresh, context, listener);
+ indexes.sortChildren(context);
artists = new ArrayList<>(indexes.getShortcuts().size() + indexes.getArtists().size());
artists.addAll(indexes.getShortcuts());
artists.addAll(indexes.getArtists());
@@ -201,6 +202,9 @@ public class SelectArtistFragment extends SelectRecyclerFragment<Artist> impleme
root.setIndex("#");
artists.add(root);
}
+
+ Indexes indexes = new Indexes(0, artists, new ArrayList<Artist>());
+ indexes.sortChildren(context);
}
return artists;
diff --git a/app/src/main/java/github/daneren2005/dsub/service/CachedMusicService.java b/app/src/main/java/github/daneren2005/dsub/service/CachedMusicService.java
index b3dc4fea..256fd6df 100644
--- a/app/src/main/java/github/daneren2005/dsub/service/CachedMusicService.java
+++ b/app/src/main/java/github/daneren2005/dsub/service/CachedMusicService.java
@@ -526,8 +526,6 @@ public class CachedMusicService implements MusicService {
public void save(ArrayList<Artist> objects) {
if (changed) {
indexes.setArtists(objects);
- // Reapply sort after addition
- indexes.sortChildren(context);
FileUtil.serialize(context, indexes, cacheName);
cachedIndexes.set(indexes);
}
diff --git a/app/src/main/java/github/daneren2005/dsub/service/OfflineMusicService.java b/app/src/main/java/github/daneren2005/dsub/service/OfflineMusicService.java
index 11a723ce..b8633624 100644
--- a/app/src/main/java/github/daneren2005/dsub/service/OfflineMusicService.java
+++ b/app/src/main/java/github/daneren2005/dsub/service/OfflineMusicService.java
@@ -101,7 +101,6 @@ public class OfflineMusicService implements MusicService {
}
Indexes indexes = new Indexes(0L, Collections.<Artist>emptyList(), artists, entries);
- indexes.sortChildren(context);
return indexes;
}