aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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;