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 {
}
}
// if we've played each track at least once
if (minNumPlays > 0) {
// if we aren't repeating all and we're not forcing a track
// return no more tracks
if (mRepeatMode != REPEAT_ALL && !force) {
// if we've played each track at least once and all tracks have been played an equal
// # of times and we aren't repeating all and we're not forcing a track, then
// return no more tracks
if (minNumPlays > 0 && numTracksWithMinNumPlays == numTracks
&& mRepeatMode != REPEAT_ALL && !force) {
return -1;
}
}
// else pick a track from the least number of played tracks
......
......@@ -769,6 +769,11 @@ public class AudioPlayerFragment extends Fragment implements ServiceConnection,
final AudioPlayerFragment audioPlayerFragment = mReference.get();
final String action = intent.getAction();
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
audioPlayerFragment.updateNowPlayingInfo();
audioPlayerFragment.dismissPopupMenu();
......
Supports Markdown
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