aboutsummaryrefslogtreecommitdiff
path: root/subsonic-android/src
diff options
context:
space:
mode:
authorScott Jackson <daneren2005@gmail.com>2013-06-11 12:11:15 -0700
committerScott Jackson <daneren2005@gmail.com>2013-06-11 12:11:15 -0700
commit5f45683e6937f13107775aa3434f7fcd01ebd9d6 (patch)
tree9d8ed91e77bfba4357e1eb1c4f0eece89dd54e7d /subsonic-android/src
parent67c2d3412f322b6c681a7dd04d4399080aa28b17 (diff)
downloaddsub-5f45683e6937f13107775aa3434f7fcd01ebd9d6.tar.gz
dsub-5f45683e6937f13107775aa3434f7fcd01ebd9d6.tar.bz2
dsub-5f45683e6937f13107775aa3434f7fcd01ebd9d6.zip
Fix offline scrobbling in case of deeper trees + non mp3s
Diffstat (limited to 'subsonic-android/src')
-rw-r--r--subsonic-android/src/github/daneren2005/dsub/service/OfflineMusicService.java9
1 files changed, 6 insertions, 3 deletions
diff --git a/subsonic-android/src/github/daneren2005/dsub/service/OfflineMusicService.java b/subsonic-android/src/github/daneren2005/dsub/service/OfflineMusicService.java
index 85d91b21..a9d18c5c 100644
--- a/subsonic-android/src/github/daneren2005/dsub/service/OfflineMusicService.java
+++ b/subsonic-android/src/github/daneren2005/dsub/service/OfflineMusicService.java
@@ -444,12 +444,15 @@ public class OfflineMusicService extends RESTMusicService {
scrobbleSearchCriteria = scrobbleSearchCriteria.substring(1);
}
- scrobbleSearchCriteria = scrobbleSearchCriteria.replace(".complete", "").replace(".partial", "").replace(".mp3", "");
+ scrobbleSearchCriteria = scrobbleSearchCriteria.replace(".complete", "").replace(".partial", "");
+ int index = scrobbleSearchCriteria.lastIndexOf(".");
+ scrobbleSearchCriteria = index == -1 ? scrobbleSearchCriteria : scrobbleSearchCriteria.substring(0, index);
String[] details = scrobbleSearchCriteria.split("/");
//last.fm only uses artist and track title so broaden the search by just using those. doesn't matter if it find the track on a different album
- String artist = "artist:\""+details[0]+"\"";
- String title = "title:\""+details[2].substring(details[2].indexOf('-')+1)+"\"";
+ String artist = "artist:\"" + details[0] + "\"";
+ String title = details[details.length - 1];
+ title = "title:\"" + title.substring(title.indexOf('-') + 1) + "\"";
scrobbleSearchCriteria = artist + " AND " + title;