diff options
author | Scott Jackson <daneren2005@gmail.com> | 2013-02-04 20:15:53 -0800 |
---|---|---|
committer | Scott Jackson <daneren2005@gmail.com> | 2013-02-04 20:15:53 -0800 |
commit | f5c51b8a982228ad3bfd7b0fd4b8748fd63caf6f (patch) | |
tree | 924675a1eb1daa11cc9204a9e05aa59fbd3f3766 /subsonic-android | |
parent | 4191e8d6748a9422af691dd13e6ff4c94e62688e (diff) | |
download | dsub-f5c51b8a982228ad3bfd7b0fd4b8748fd63caf6f.tar.gz dsub-f5c51b8a982228ad3bfd7b0fd4b8748fd63caf6f.tar.bz2 dsub-f5c51b8a982228ad3bfd7b0fd4b8748fd63caf6f.zip |
Fix for not all songs being saved as ##-Title
Diffstat (limited to 'subsonic-android')
-rw-r--r-- | subsonic-android/src/github/daneren2005/dsub/service/OfflineMusicService.java | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/subsonic-android/src/github/daneren2005/dsub/service/OfflineMusicService.java b/subsonic-android/src/github/daneren2005/dsub/service/OfflineMusicService.java index 89492687..8d1cb307 100644 --- a/subsonic-android/src/github/daneren2005/dsub/service/OfflineMusicService.java +++ b/subsonic-android/src/github/daneren2005/dsub/service/OfflineMusicService.java @@ -167,8 +167,15 @@ public class OfflineMusicService extends RESTMusicService { Log.i(TAG, "Device doesn't properly support MediaMetadataRetreiver"); } - entry.setTrack(Integer.parseInt(name.substring(0, name.indexOf('-')))); - title = title.substring(title.indexOf('-') + 1); + int index = name.indexOf('-'); + if(index != -1) { + try { + entry.setTrack(Integer.parseInt(name.substring(0, index))); + title = title.substring(index + 1); + } catch(Exception e) { + // Failed parseInt, just means track filled out + } + } } entry.setTitle(title); |