From 703e6987a90fb20854b3b50240f5002823efee9d Mon Sep 17 00:00:00 2001 From: Scott Jackson Date: Mon, 4 Feb 2013 18:45:55 -0800 Subject: Closes #105 Remove Track # from song name in offline mode --- .../src/github/daneren2005/dsub/service/OfflineMusicService.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'subsonic-android/src') diff --git a/subsonic-android/src/github/daneren2005/dsub/service/OfflineMusicService.java b/subsonic-android/src/github/daneren2005/dsub/service/OfflineMusicService.java index b4c48bde..1ac8e9cc 100644 --- a/subsonic-android/src/github/daneren2005/dsub/service/OfflineMusicService.java +++ b/subsonic-android/src/github/daneren2005/dsub/service/OfflineMusicService.java @@ -148,6 +148,7 @@ public class OfflineMusicService extends RESTMusicService { entry.setSize(file.length()); String root = FileUtil.getMusicDirectory(context).getPath(); entry.setPath(file.getPath().replaceFirst("^" + root + "/" , "")); + String title = name; if (file.isFile()) { entry.setArtist(file.getParentFile().getParentFile().getName()); entry.setAlbum(file.getParentFile().getName()); @@ -165,8 +166,11 @@ public class OfflineMusicService extends RESTMusicService { } catch(Exception e) { Log.i(TAG, "Device doesn't properly support MediaMetadataRetreiver"); } + + title = title.substring(title.indexOf('-') + 1); } - entry.setTitle(name); + + entry.setTitle(title); entry.setSuffix(FileUtil.getExtension(file.getName().replace(".complete", ""))); File albumArt = FileUtil.getAlbumArtFile(context, entry); -- cgit v1.2.3