Bug Fix: Safeguard play count updates

Play Count cannot be updated for tracks which have been deleted before
the update was added to them. This was another cause of a rare crash.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
This commit is contained in:
Christopher Snowhill 2025-02-15 17:08:02 -08:00
parent b480453886
commit 6fee16eb82

View file

@ -251,7 +251,7 @@ static void *playlistControllerContext = &playlistControllerContext;
}
- (void)updatePlayCountForTrack:(PlaylistEntry *)pe {
if(pe.countAdded) return;
if(!pe || pe.deLeted || pe.countAdded) return;
pe.countAdded = YES;
__block PlayCount *pc = pe.playCountItem;