aboutsummaryrefslogtreecommitdiff
path: root/app/src/main
diff options
context:
space:
mode:
authorScott Jackson <daneren2005@gmail.com>2015-10-06 17:15:55 -0700
committerScott Jackson <daneren2005@gmail.com>2015-10-06 17:15:55 -0700
commitcc297c649b9008fd8648f1b8791ed0ef583eb58b (patch)
treee10454add3c854628fc07019b2808279be027bf6 /app/src/main
parentbe6aab9849e16c279d480c32bd478361f41047fe (diff)
downloaddsub-cc297c649b9008fd8648f1b8791ed0ef583eb58b.tar.gz
dsub-cc297c649b9008fd8648f1b8791ed0ef583eb58b.tar.bz2
dsub-cc297c649b9008fd8648f1b8791ed0ef583eb58b.zip
#562 Fix putting shuffle params in wrong order breaking
Diffstat (limited to 'app/src/main')
-rw-r--r--app/src/main/java/github/daneren2005/dsub/service/RESTMusicService.java16
1 files changed, 16 insertions, 0 deletions
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 97899529..88489e10 100644
--- a/app/src/main/java/github/daneren2005/dsub/service/RESTMusicService.java
+++ b/app/src/main/java/github/daneren2005/dsub/service/RESTMusicService.java
@@ -730,6 +730,22 @@ public class RESTMusicService implements MusicService {
values.add(genre);
}
if(startYear != null && !"".equals(startYear)) {
+ // Check to make sure user isn't doing 2015 -> 2010 since Subsonic will return no results
+ if(endYear != null && !"".equals(endYear)) {
+ try {
+ int startYearInt = Integer.parseInt(startYear);
+ int endYearInt = Integer.parseInt(endYear);
+
+ if(startYearInt > endYearInt) {
+ String tmp = startYear;
+ startYear = endYear;
+ endYear = tmp;
+ }
+ } catch(Exception e) {
+ Log.w(TAG, "Failed to convert start/end year into ints", e);
+ }
+ }
+
names.add("fromYear");
values.add(startYear);
}