Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

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
Loading
Loading
Loading
Loading
+5 −6
Original line number Diff line number Diff line
@@ -1223,14 +1223,13 @@ 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
            // 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 (mRepeatMode != REPEAT_ALL && !force) {
            if (minNumPlays > 0 && numTracksWithMinNumPlays == numTracks
                    && mRepeatMode != REPEAT_ALL && !force) {
                    return -1;
            }
            }

            // else pick a track from the least number of played tracks
            int skip = mShuffler.nextInt(numTracksWithMinNumPlays);
+5 −0
Original line number Diff line number Diff line
@@ -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();