diff options
-rw-r--r-- | subsonic-android/src/github/daneren2005/dsub/service/OfflineMusicService.java | 10 |
1 files changed, 8 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 d2f99d0b..9b4dde92 100644 --- a/subsonic-android/src/github/daneren2005/dsub/service/OfflineMusicService.java +++ b/subsonic-android/src/github/daneren2005/dsub/service/OfflineMusicService.java @@ -422,8 +422,14 @@ public class OfflineMusicService extends RESTMusicService { if(scrobbleSearchCriteria.startsWith("/")) scrobbleSearchCriteria = scrobbleSearchCriteria.substring(1); - scrobbleSearchCriteria = scrobbleSearchCriteria.replace(".complete", "").replace(".partial", ""); - scrobbleSearchCriteria = scrobbleSearchCriteria.replace("/", " ").replace("-", "\\-").replace(".", "\\."); + scrobbleSearchCriteria = scrobbleSearchCriteria.replace(".complete", "").replace(".partial", "").replace(".mp3", ""); + 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)+"\""; + + scrobbleSearchCriteria = artist + " AND " + title; BufferedWriter bw = new BufferedWriter(new FileWriter(offlineScrobblesFile, true)); bw.write(scrobbleSearchCriteria + "," + System.currentTimeMillis()); |