diff options
-rw-r--r-- | src/github/daneren2005/dsub/service/CachedMusicService.java | 19 |
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 { |