diff options
author | Scott Jackson <daneren2005@gmail.com> | 2014-08-16 15:39:02 -0700 |
---|---|---|
committer | Scott Jackson <daneren2005@gmail.com> | 2014-08-16 15:39:02 -0700 |
commit | c09e74463e1f0e935e5f4b3fb85615c9a3059672 (patch) | |
tree | 723d315081d2a201ec53a1d898fed086398528df /src/github | |
parent | 199576746d20729489f83d11bf89f4ab35f22b63 (diff) | |
download | dsub-c09e74463e1f0e935e5f4b3fb85615c9a3059672.tar.gz dsub-c09e74463e1f0e935e5f4b3fb85615c9a3059672.tar.bz2 dsub-c09e74463e1f0e935e5f4b3fb85615c9a3059672.zip |
Apply check for current playing to mass unstar method as well
Diffstat (limited to 'src/github')
-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);
|