aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--subsonic-android/src/github/daneren2005/dsub/service/OfflineMusicService.java10
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) {