aboutsummaryrefslogtreecommitdiff
path: root/src/github
diff options
context:
space:
mode:
authorScott Jackson <daneren2005@gmail.com>2014-08-16 15:31:02 -0700
committerScott Jackson <daneren2005@gmail.com>2014-08-16 15:31:02 -0700
commit1b4efd1ff269650558a6a9ac874b87148c176d3a (patch)
tree55281ec4f3c4f8c9bdc16ef991c1a8bc2a3190a3 /src/github
parentd85a1113dc5d973713e205387fc7e8907c510d1a (diff)
downloaddsub-1b4efd1ff269650558a6a9ac874b87148c176d3a.tar.gz
dsub-1b4efd1ff269650558a6a9ac874b87148c176d3a.tar.bz2
dsub-1b4efd1ff269650558a6a9ac874b87148c176d3a.zip
Check if unstarred entry exists in current playing list
Diffstat (limited to 'src/github')
-rw-r--r--src/github/daneren2005/dsub/service/CachedMusicService.java19
1 files changed, 17 insertions, 2 deletions
diff --git a/src/github/daneren2005/dsub/service/CachedMusicService.java b/src/github/daneren2005/dsub/service/CachedMusicService.java
index 027f6694..e989036a 100644
--- a/src/github/daneren2005/dsub/service/CachedMusicService.java
+++ b/src/github/daneren2005/dsub/service/CachedMusicService.java
@@ -440,7 +440,7 @@ public class CachedMusicService implements MusicService {
@Override
public void updateResult(List<Entry> objects, Entry result) {
- result.setStarred(starred);
+ setEntryStarred(result, starred);
}
}.execute();
}
@@ -571,7 +571,7 @@ public class CachedMusicService implements MusicService {
@Override
public void updateResult(List<Entry> objects, Entry result) {
- result.setStarred(starred);
+ setEntryStarred(result, starred);
}
}.execute();
}
@@ -596,6 +596,21 @@ public class CachedMusicService implements MusicService {
}.execute();
}
}
+ private void setEntryStarred(Entry entry, boolean starred) {
+ entry.setStarred(starred);
+
+ DownloadService downloadService = DownloadService.getInstance();
+ if(downloadService != null && !entry.isDirectory()) {
+ List<DownloadFile> files = downloadService.getDownloads();
+ for(DownloadFile file: files) {
+ Entry check = file.getSong();
+ if(entry.getId().equals(check.getId())) {
+ check.setStarred(starred);
+ break;
+ }
+ }
+ }
+ }
@Override
public List<Share> getShares(Context context, ProgressListener progressListener) throws Exception {