[Repeat Album] Add a safety test to repeat list

In case the current track isn't part of an album, or is otherwise not
matching any albums in the playlist. Though the Album filter predicate
wasn't working for a while due to changes.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
This commit is contained in:
Christopher Snowhill 2022-07-16 05:59:27 -07:00
parent 0f003fcefd
commit 7f4459c41c

View file

@ -1244,7 +1244,7 @@ static void *playlistControllerContext = &playlistControllerContext;
if((i > [[self arrangedObjects] count] - 1) || if((i > [[self arrangedObjects] count] - 1) ||
([[next album] caseInsensitiveCompare:[pe album]]) || ([next album] == nil)) { ([[next album] caseInsensitiveCompare:[pe album]]) || ([next album] == nil)) {
NSArray *filtered = [self filterPlaylistOnAlbum:[pe album]]; NSArray *filtered = [self filterPlaylistOnAlbum:[pe album]];
if([pe album] == nil) if([pe album] == nil || !filtered || [filtered count] < 1)
i--; i--;
else else
i = [(PlaylistEntry *)filtered[0] index]; i = [(PlaylistEntry *)filtered[0] index];