diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/github/daneren2005/dsub/fragments/SelectDirectoryFragment.java | 5 | ||||
-rw-r--r-- | src/github/daneren2005/dsub/fragments/SubsonicFragment.java | 26 |
2 files changed, 20 insertions, 11 deletions
diff --git a/src/github/daneren2005/dsub/fragments/SelectDirectoryFragment.java b/src/github/daneren2005/dsub/fragments/SelectDirectoryFragment.java index 09a2e42b..ef9a6163 100644 --- a/src/github/daneren2005/dsub/fragments/SelectDirectoryFragment.java +++ b/src/github/daneren2005/dsub/fragments/SelectDirectoryFragment.java @@ -1064,6 +1064,11 @@ public class SelectDirectoryFragment extends SubsonicFragment implements Adapter }
}
musicService.setStarred(ids, artists, albums, parents, false, this, context);
+
+ for(MusicDirectory.Entry entry: unstar) {
+ setEntryStarred(entry, false);
+ }
+
return null;
}
diff --git a/src/github/daneren2005/dsub/fragments/SubsonicFragment.java b/src/github/daneren2005/dsub/fragments/SubsonicFragment.java index 7e842425..c37ece79 100644 --- a/src/github/daneren2005/dsub/fragments/SubsonicFragment.java +++ b/src/github/daneren2005/dsub/fragments/SubsonicFragment.java @@ -665,17 +665,7 @@ public class SubsonicFragment extends Fragment implements SwipeRefreshLayout.OnR musicService.setStarred(Arrays.asList(entry.getId()), null, null, parents, starred, null, context);
}
- DownloadService downloadService = DownloadService.getInstance();
- if(downloadService != null && !entry.isDirectory()) {
- List<DownloadFile> files = downloadService.getDownloads();
- for(DownloadFile file: files) {
- MusicDirectory.Entry check = file.getSong();
- if(entry.getId().equals(check.getId())) {
- check.setStarred(starred);
- break;
- }
- }
- }
+ setEntryStarred(entry, starred);
return null;
}
@@ -702,6 +692,20 @@ public class SubsonicFragment extends Fragment implements SwipeRefreshLayout.OnR }
}.execute();
}
+ protected void setEntryStarred(MusicDirectory.Entry entry, boolean starred) {
+ DownloadService downloadService = DownloadService.getInstance();
+ if(downloadService != null && !entry.isDirectory()) {
+ List<DownloadFile> files = downloadService.getDownloads();
+ for(DownloadFile file: files) {
+ MusicDirectory.Entry check = file.getSong();
+ if(entry.getId().equals(check.getId())) {
+ check.setStarred(starred);
+ break;
+ }
+ }
+ }
+ }
+
public void toggleStarred(final Artist entry) {
final boolean starred = !entry.isStarred();
entry.setStarred(starred);
|