Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Dispatch queue #94

Merged
merged 2 commits into from Apr 11, 2013

Conversation

Projects
None yet
2 participants
Contributor

nate1280 commented Apr 10, 2013

As per a post by codeseven in the trakt.tv plugin thread, here is a fix for issues with playlist scrobbling.

The main part of this is introducing a queue for the dispatch events, the primary reason for this is to help avoid possible race conditions with the player/monitor interfaces.

Issues with scrobbling from playlists should also be resolved with this fix.

Just like in the sync change, I've also added an option to simulate scrobbling to aid in testing.

As usual, please test and provide feedback.

Please do not merge just yet, still double checking a few things, and testing. Also, going to get codeseven to test this to see if it resolves the issues, will comment again when its ready.

Changes are as follows:

  • Add simulate scrobble setting for testing.
  • Implement queue for dispatch events, should resolve race conditions that can occur.
  • Dispatch queue is acted upon every cycle and cleared.
  • Add check for xbmc playing video when doing update() from service thread.
  • Remove old check for switching videos in a playlist in scrobbler class.
  • Small change to rating check, perform the setting check before anything else.
  • Change how updating time is handled, only update if the current playlist index is the same as what was seen when playback started.
  • In traktPlayer, save playlist index in onPlayBackStarted to variable.
  • In traktPlayer, onPlayBackStarted, check current playlist index to saved index if playlist length is greater then 1, if it is, fire an onPlayBackEnded event.
  • Add some more debug lines to help in testing playlist playback.

nate1280 added some commits Apr 9, 2013

Add simulate scrobble setting
Add simulate scrobble setting for testing.
Implement queue for dispatch events
Implement queue for dispatch events, should resolve race conditions that can occur.
Dispatch queue is acted upon every cycle and cleared.
Add check for xbmc playing video when doing update() from service thread.
Remove old check for switching videos in a playlist in scrobbler class.
Small change to rating check, perform the setting check before anything else.
Change how updating time is handled, only update if the current playlist index is the same as what was seen when playback started.
In traktPlayer, save playlist index in onPlayBackStarted to variable.
In traktPlayer, onPlayBackStarted, check current playlist index to saved index if playlist length is greater then 1, if it is, fire an onPlayBackEnded event.
Add some more debug lines to help in testing playlist playback.
Contributor

nate1280 commented Apr 11, 2013

codeseven replied and tested it using playlists, said it worked flawlessly.

Also tested it last night normally (no playlists), and scrobbling still works fine.

If others can test and sign off, I think it'll be ready for merge.

Contributor

rectifyer commented Apr 11, 2013

What do you think about making a new Debug menu in the settings and moving the debug and 2 simulate settings there? It's better to bury those settings a bit from the normal user once 2.2 is out so they don't fool with it. But its good to keep them to help with future debugging.

rectifyer added a commit that referenced this pull request Apr 11, 2013

@rectifyer rectifyer merged commit 11c101f into trakt:master Apr 11, 2013

Contributor

nate1280 commented Apr 11, 2013

Had actually thought about making a seprate Debug menu, it would probably be a really good idea.

@nate1280 nate1280 deleted the nate1280:dispatch_queue branch Apr 11, 2013

rectifyer pushed a commit that referenced this pull request Mar 4, 2015

Merge pull request #94 from vonH/dev
[skin version] 0.10.5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment