diff options
Diffstat (limited to 'src/github/daneren2005')
4 files changed, 30 insertions, 0 deletions
diff --git a/src/github/daneren2005/dsub/fragments/SubsonicFragment.java b/src/github/daneren2005/dsub/fragments/SubsonicFragment.java index c37ece79..580016bb 100644 --- a/src/github/daneren2005/dsub/fragments/SubsonicFragment.java +++ b/src/github/daneren2005/dsub/fragments/SubsonicFragment.java @@ -700,10 +700,16 @@ public class SubsonicFragment extends Fragment implements SwipeRefreshLayout.OnR MusicDirectory.Entry check = file.getSong();
if(entry.getId().equals(check.getId())) {
check.setStarred(starred);
+ downloadService.serializeQueue();
break;
}
}
}
+
+ MusicDirectory.Entry find = UpdateView.findEntry(entry);
+ if(find != null) {
+ find.setStarred(starred);
+ }
}
public void toggleStarred(final Artist entry) {
diff --git a/src/github/daneren2005/dsub/service/DownloadService.java b/src/github/daneren2005/dsub/service/DownloadService.java index 76e2dd89..b311df6b 100644 --- a/src/github/daneren2005/dsub/service/DownloadService.java +++ b/src/github/daneren2005/dsub/service/DownloadService.java @@ -1598,6 +1598,12 @@ public class DownloadService extends Service { } } + public synchronized void serializeQueue() { + if(playerState == PlayerState.PAUSED) { + lifecycleSupport.serializeDownloadQueue(); + } + } + private void handleError(Exception x) { Log.w(TAG, "Media player error: " + x, x); if(mediaPlayer != null) { diff --git a/src/github/daneren2005/dsub/view/SongView.java b/src/github/daneren2005/dsub/view/SongView.java index 55eff6f1..d5b7c0f2 100644 --- a/src/github/daneren2005/dsub/view/SongView.java +++ b/src/github/daneren2005/dsub/view/SongView.java @@ -248,4 +248,8 @@ public class SongView extends UpdateView implements Checkable { public void toggle() { checkedTextView.toggle(); } + + public MusicDirectory.Entry getEntry() { + return song; + } } diff --git a/src/github/daneren2005/dsub/view/UpdateView.java b/src/github/daneren2005/dsub/view/UpdateView.java index f30ec42a..5f34a765 100644 --- a/src/github/daneren2005/dsub/view/UpdateView.java +++ b/src/github/daneren2005/dsub/view/UpdateView.java @@ -33,6 +33,7 @@ import java.util.ArrayList; import java.util.List;
import java.util.WeakHashMap;
+import github.daneren2005.dsub.domain.MusicDirectory;
import github.daneren2005.dsub.util.ImageLoader;
import github.daneren2005.dsub.R;
import github.daneren2005.dsub.util.SilentBackgroundTask;
@@ -211,6 +212,19 @@ public class UpdateView extends LinearLayout { public static void removeActiveActivity() {
activeActivities--;
}
+
+ public static MusicDirectory.Entry findEntry(MusicDirectory.Entry entry) {
+ for(UpdateView view: INSTANCES.keySet()) {
+ if(view instanceof SongView) {
+ MusicDirectory.Entry check = ((SongView) view).getEntry();
+ if(check != null && entry != check && check.getId().equals(entry.getId())) {
+ return check;
+ }
+ }
+ }
+
+ return null;
+ }
protected void updateBackground() {
|