Commit cb83a720 authored by linus_lee's avatar linus_lee
Browse files

Eleven: Make album art show up more consistently in shuffle and not repeat

A more complete fix needs a music service rewrite - I've tried to find a
complete solution that doesn't need a rewrite but cannot figure out a good one
For now this will make all of them but the first one of the next round show up

https://cyanogen.atlassian.net/browse/MUSIC-189

Change-Id: Idd64754001a679cf9a9b16f71d285e0fb4dd1b6d
parent ad606c2e
...@@ -1223,13 +1223,12 @@ public class MusicPlaybackService extends Service { ...@@ -1223,13 +1223,12 @@ public class MusicPlaybackService extends Service {
} }
} }
// if we've played each track at least once // if we've played each track at least once and all tracks have been played an equal
if (minNumPlays > 0) { // # of times and we aren't repeating all and we're not forcing a track, then
// if we aren't repeating all and we're not forcing a track // return no more tracks
// return no more tracks if (minNumPlays > 0 && numTracksWithMinNumPlays == numTracks
if (mRepeatMode != REPEAT_ALL && !force) { && mRepeatMode != REPEAT_ALL && !force) {
return -1; return -1;
}
} }
// else pick a track from the least number of played tracks // else pick a track from the least number of played tracks
......
...@@ -769,6 +769,11 @@ public class AudioPlayerFragment extends Fragment implements ServiceConnection, ...@@ -769,6 +769,11 @@ public class AudioPlayerFragment extends Fragment implements ServiceConnection,
final AudioPlayerFragment audioPlayerFragment = mReference.get(); final AudioPlayerFragment audioPlayerFragment = mReference.get();
final String action = intent.getAction(); final String action = intent.getAction();
if (action.equals(MusicPlaybackService.META_CHANGED)) { if (action.equals(MusicPlaybackService.META_CHANGED)) {
// if we are repeating current and the track has changed, re-create the adapter
if (MusicUtils.getRepeatMode() == MusicPlaybackService.REPEAT_CURRENT) {
mReference.get().createAndSetAdapter();
}
// Current info // Current info
audioPlayerFragment.updateNowPlayingInfo(); audioPlayerFragment.updateNowPlayingInfo();
audioPlayerFragment.dismissPopupMenu(); audioPlayerFragment.dismissPopupMenu();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment