aboutsummaryrefslogtreecommitdiff
path: root/app/src/main/java/github
diff options
context:
space:
mode:
Diffstat (limited to 'app/src/main/java/github')
-rw-r--r--app/src/main/java/github/daneren2005/dsub/domain/MusicDirectory.java8
-rw-r--r--app/src/main/java/github/daneren2005/dsub/service/parser/TopSongsParser.java6
-rw-r--r--app/src/main/java/github/daneren2005/dsub/view/SongView.java3
3 files changed, 14 insertions, 3 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 1da3d51b..5f7b2412 100644
--- a/app/src/main/java/github/daneren2005/dsub/domain/MusicDirectory.java
+++ b/app/src/main/java/github/daneren2005/dsub/domain/MusicDirectory.java
@@ -236,6 +236,7 @@ public class MusicDirectory implements Serializable {
private String album;
private String artist;
private Integer track;
+ private Integer customOrder;
private Integer year;
private String genre;
private String contentType;
@@ -424,6 +425,13 @@ public class MusicDirectory implements Serializable {
this.track = track;
}
+ public Integer getCustomOrder() {
+ return customOrder;
+ }
+ public void setCustomOrder(Integer customOrder) {
+ this.customOrder = customOrder;
+ }
+
public Integer getYear() {
return year;
}
diff --git a/app/src/main/java/github/daneren2005/dsub/service/parser/TopSongsParser.java b/app/src/main/java/github/daneren2005/dsub/service/parser/TopSongsParser.java
index c3719782..2d1f43dc 100644
--- a/app/src/main/java/github/daneren2005/dsub/service/parser/TopSongsParser.java
+++ b/app/src/main/java/github/daneren2005/dsub/service/parser/TopSongsParser.java
@@ -34,17 +34,17 @@ public class TopSongsParser extends MusicDirectoryEntryParser {
MusicDirectory dir = new MusicDirectory();
int eventType;
- int trackNumber = 1;
+ int customOrder = 1;
do {
eventType = nextParseEvent();
if (eventType == XmlPullParser.START_TAG) {
String name = getElementName();
if ("song".equals(name)) {
MusicDirectory.Entry entry = parseEntry("");
- entry.setTrack(trackNumber);
+ entry.setCustomOrder(customOrder);
dir.addChild(entry);
- trackNumber++;
+ customOrder++;
} else if ("error".equals(name)) {
handleError();
}
diff --git a/app/src/main/java/github/daneren2005/dsub/view/SongView.java b/app/src/main/java/github/daneren2005/dsub/view/SongView.java
index 7a02c91d..320c5933 100644
--- a/app/src/main/java/github/daneren2005/dsub/view/SongView.java
+++ b/app/src/main/java/github/daneren2005/dsub/view/SongView.java
@@ -151,6 +151,9 @@ public class SongView extends UpdateView2<MusicDirectory.Entry, Boolean> {
String title = song.getTitle();
Integer track = song.getTrack();
+ if(song.getCustomOrder() != null) {
+ track = song.getCustomOrder();
+ }
TextView newPlayingTextView;
if(track != null && Util.getDisplayTrack(context)) {
trackTextView.setText(String.format("%02d", track));