Skip to content

Commit

Permalink
Bug Fix: Safeguard play count updates
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
kode54 committed Feb 16, 2025
1 parent 0d289e4 commit 931da40
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Playlist/PlaylistController.m
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ - (void)commitPersistentStore {
}

- (void)updatePlayCountForTrack:(PlaylistEntry *)pe {
if(pe.countAdded) return;
if(!pe || pe.deLeted || pe.countAdded) return;
pe.countAdded = YES;

__block PlayCount *pc = pe.playCountItem;
Expand Down

0 comments on commit 931da40

Please sign in to comment.