diff options
author | Scott Jackson <daneren2005@gmail.com> | 2014-07-10 20:20:33 -0700 |
---|---|---|
committer | Scott Jackson <daneren2005@gmail.com> | 2014-07-10 20:20:33 -0700 |
commit | 458c60d6915ba46b788b2e96bcc3df9f56988d3c (patch) | |
tree | 73460694b88bbff5d827ea31f395557fee614014 /src | |
parent | 45c668b341c92130c1060492676285ec26487575 (diff) | |
download | dsub-458c60d6915ba46b788b2e96bcc3df9f56988d3c.tar.gz dsub-458c60d6915ba46b788b2e96bcc3df9f56988d3c.tar.bz2 dsub-458c60d6915ba46b788b2e96bcc3df9f56988d3c.zip |
Change sort option to be sort by year or by alphabetical
Diffstat (limited to 'src')
3 files changed, 5 insertions, 5 deletions
diff --git a/src/github/daneren2005/dsub/domain/MusicDirectory.java b/src/github/daneren2005/dsub/domain/MusicDirectory.java index 363a1540..492726f9 100644 --- a/src/github/daneren2005/dsub/domain/MusicDirectory.java +++ b/src/github/daneren2005/dsub/domain/MusicDirectory.java @@ -102,8 +102,8 @@ public class MusicDirectory implements Serializable { return children.size(); } - public void sortChildren() { - EntryComparator.sort(children); + public void sortChildren(boolean byYear) { + EntryComparator.sort(children, byYear); } public static class Entry implements Serializable { diff --git a/src/github/daneren2005/dsub/service/OfflineMusicService.java b/src/github/daneren2005/dsub/service/OfflineMusicService.java index a92e41d1..04955cc3 100644 --- a/src/github/daneren2005/dsub/service/OfflineMusicService.java +++ b/src/github/daneren2005/dsub/service/OfflineMusicService.java @@ -134,7 +134,7 @@ public class OfflineMusicService extends RESTMusicService { result.addChild(createEntry(context, file, name, true, isPodcast)); } } - result.sortChildren(); + result.sortChildren(Util.getPreferences(context).getBoolean(Constants.PREFERENCES_KEY_CUSTOM_SORT_ENABLED, true)); return result; } diff --git a/src/github/daneren2005/dsub/service/parser/MusicDirectoryParser.java b/src/github/daneren2005/dsub/service/parser/MusicDirectoryParser.java index e705c54d..95ee1744 100644 --- a/src/github/daneren2005/dsub/service/parser/MusicDirectoryParser.java +++ b/src/github/daneren2005/dsub/service/parser/MusicDirectoryParser.java @@ -97,8 +97,8 @@ public class MusicDirectoryParser extends MusicDirectoryEntryParser { validate(); // Only apply sorting on server version 4.7 and greater, where disc is supported - if(Util.checkServerVersion(context, "1.8.0") && Util.getPreferences(context).getBoolean(Constants.PREFERENCES_KEY_CUSTOM_SORT_ENABLED, true)) { - dir.sortChildren(); + if(Util.checkServerVersion(context, "1.8.0")) { + dir.sortChildren(Util.getPreferences(context).getBoolean(Constants.PREFERENCES_KEY_CUSTOM_SORT_ENABLED, true)); } return dir; |