aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--app/src/main/java/github/daneren2005/dsub/domain/MusicDirectory.java1
-rw-r--r--app/src/main/java/github/daneren2005/dsub/service/CachedMusicService.java5
-rw-r--r--app/src/main/java/github/daneren2005/dsub/service/RESTMusicService.java5
-rw-r--r--app/src/main/java/github/daneren2005/dsub/service/parser/MusicDirectoryParser.java3
4 files changed, 4 insertions, 10 deletions
diff --git a/app/src/main/java/github/daneren2005/dsub/domain/MusicDirectory.java b/app/src/main/java/github/daneren2005/dsub/domain/MusicDirectory.java
index 6dc56bb3..8983051e 100644
--- a/app/src/main/java/github/daneren2005/dsub/domain/MusicDirectory.java
+++ b/app/src/main/java/github/daneren2005/dsub/domain/MusicDirectory.java
@@ -126,6 +126,7 @@ public class MusicDirectory implements Serializable {
}
public void sortChildren(Context context, int instance) {
+ // Only apply sorting on server version 4.7 and greater, where disc is supported
if(ServerInfo.checkServerVersion(context, "1.8", instance)) {
sortChildren(Util.getPreferences(context).getBoolean(Constants.PREFERENCES_KEY_CUSTOM_SORT_ENABLED, true));
}
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 34ba2513..b3dc4fea 100644
--- a/app/src/main/java/github/daneren2005/dsub/service/CachedMusicService.java
+++ b/app/src/main/java/github/daneren2005/dsub/service/CachedMusicService.java
@@ -201,6 +201,7 @@ public class CachedMusicService implements MusicService {
// If a cached copy exists to check against, look for removes
deleteRemovedEntries(context, dir, cached);
}
+ dir.sortChildren(context, musicService.getInstance(context));
return dir;
}
@@ -220,6 +221,7 @@ public class CachedMusicService implements MusicService {
// If a cached copy exists to check against, look for removes
deleteRemovedEntries(context, dir, cached);
}
+ dir.sortChildren(context, musicService.getInstance(context));
return dir;
}
@@ -240,6 +242,7 @@ public class CachedMusicService implements MusicService {
// If a cached copy exists to check against, look for removes
deleteRemovedEntries(context, dir, cached);
}
+ dir.sortChildren(context, musicService.getInstance(context));
return dir;
}
@@ -493,8 +496,6 @@ public class CachedMusicService implements MusicService {
// Only save if actually added to artist
if (changed) {
musicDirectory.replaceChildren(objects);
- // Reapply sort after addition
- musicDirectory.sortChildren(context, instance);
FileUtil.serialize(context, musicDirectory, cacheName);
}
}
diff --git a/app/src/main/java/github/daneren2005/dsub/service/RESTMusicService.java b/app/src/main/java/github/daneren2005/dsub/service/RESTMusicService.java
index 9af512e3..419ea69f 100644
--- a/app/src/main/java/github/daneren2005/dsub/service/RESTMusicService.java
+++ b/app/src/main/java/github/daneren2005/dsub/service/RESTMusicService.java
@@ -283,11 +283,6 @@ public class RESTMusicService implements MusicService {
dir.addChildren(extra.getChildren());
}
- // Apply another sort if we are chaining several together
- if(dir != extra) {
- dir.sortChildren(context, getInstance(context));
- }
-
return dir;
}
diff --git a/app/src/main/java/github/daneren2005/dsub/service/parser/MusicDirectoryParser.java b/app/src/main/java/github/daneren2005/dsub/service/parser/MusicDirectoryParser.java
index f2d58b5d..bb1980b6 100644
--- a/app/src/main/java/github/daneren2005/dsub/service/parser/MusicDirectoryParser.java
+++ b/app/src/main/java/github/daneren2005/dsub/service/parser/MusicDirectoryParser.java
@@ -103,9 +103,6 @@ public class MusicDirectoryParser extends MusicDirectoryEntryParser {
} while (eventType != XmlPullParser.END_DOCUMENT);
validate();
-
- // Only apply sorting on server version 4.7 and greater, where disc is supported
- dir.sortChildren(context, instance);
return dir;
}