diff options
author | Scott Jackson <daneren2005@gmail.com> | 2013-06-20 21:33:41 -0700 |
---|---|---|
committer | Scott Jackson <daneren2005@gmail.com> | 2013-06-20 21:33:41 -0700 |
commit | b2ef72a7477ad58e6fd35289e585af9f4594de0a (patch) | |
tree | 998930fff170033b88bebf6e2da9b36ea9a4dd2d /subsonic-android | |
parent | 32f95efa11b0754adf27e9c8b057da1083761705 (diff) | |
download | dsub-b2ef72a7477ad58e6fd35289e585af9f4594de0a.tar.gz dsub-b2ef72a7477ad58e6fd35289e585af9f4594de0a.tar.bz2 dsub-b2ef72a7477ad58e6fd35289e585af9f4594de0a.zip |
If single level folders, set artist then same as album in offline mode
Diffstat (limited to 'subsonic-android')
-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 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) { |