From b2ef72a7477ad58e6fd35289e585af9f4594de0a Mon Sep 17 00:00:00 2001 From: Scott Jackson Date: Thu, 20 Jun 2013 21:33:41 -0700 Subject: If single level folders, set artist then same as album in offline mode --- .../github/daneren2005/dsub/service/OfflineMusicService.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'subsonic-android/src/github/daneren2005') diff --git a/subsonic-android/src/github/daneren2005/dsub/service/OfflineMusicService.java b/subsonic-android/src/github/daneren2005/dsub/service/OfflineMusicService.java index 59895a7d..40c1cdb0 100644 --- a/subsonic-android/src/github/daneren2005/dsub/service/OfflineMusicService.java +++ b/subsonic-android/src/github/daneren2005/dsub/service/OfflineMusicService.java @@ -158,8 +158,14 @@ public class OfflineMusicService extends RESTMusicService { entry.setPath(file.getPath().replaceFirst("^" + root + "/" , "")); String title = name; if (file.isFile()) { - entry.setArtist(file.getParentFile().getParentFile().getName()); - entry.setAlbum(file.getParentFile().getName()); + File artistFolder = file.getParentFile().getParentFile(); + File albumFolder = file.getParentFile(); + if(artistFolder.getPath().equals(root)) { + entry.setArtist(albumFolder.getName()); + } else { + entry.setArtist(artistFolder.getName()); + } + entry.setAlbum(albumFolder.getName()); int index = name.indexOf('-'); if(index != -1) { -- cgit v1.2.3