[Play Counts] Track play counts of correct track
Track play counts for the correct track, even on short tracks. Also correctly track the play count of the last played item in the play queue which stops with bufferChain set to nil, so the previous iteration was not tracking it. Signed-off-by: Christopher Snowhill <kode54@gmail.com>lastfm
parent
f1dd55b29e
commit
3b1eefaabb
|
@ -39,6 +39,8 @@ using std::atomic_bool;
|
|||
id nextStreamUserInfo;
|
||||
NSDictionary *nextStreamRGInfo;
|
||||
|
||||
id previousUserInfo; // Track currently last heard track for play counts
|
||||
|
||||
id delegate;
|
||||
|
||||
BOOL outputLaunched;
|
||||
|
|
|
@ -113,6 +113,7 @@
|
|||
outputLaunched = NO;
|
||||
startedPaused = paused;
|
||||
initialBufferFilled = NO;
|
||||
previousUserInfo = userInfo;
|
||||
|
||||
[bufferChain launchThreads];
|
||||
|
||||
|
@ -296,6 +297,8 @@
|
|||
|
||||
- (BOOL)endOfInputReached:(BufferChain *)sender // Sender is a BufferChain
|
||||
{
|
||||
previousUserInfo = [sender userInfo];
|
||||
|
||||
BufferChain *newChain = nil;
|
||||
|
||||
if(atomic_load_explicit(&resettingNow, memory_order_relaxed))
|
||||
|
@ -424,9 +427,7 @@
|
|||
}
|
||||
|
||||
- (void)reportPlayCount {
|
||||
if(bufferChain) {
|
||||
[self reportPlayCountForTrack:[bufferChain userInfo]];
|
||||
}
|
||||
[self reportPlayCountForTrack:previousUserInfo];
|
||||
}
|
||||
|
||||
- (BOOL)selectNextBuffer {
|
||||
|
|
Loading…
Reference in New Issue