From 86af7906106dead106d33040d5b42b7aae5a0e13 Mon Sep 17 00:00:00 2001 From: Kolja Lampe Date: Sun, 24 Jun 2018 22:51:36 +0200 Subject: [PATCH] Use correct hook into kodi 18 --- addon.xml | 7 +-- changelog.txt | 3 ++ resources/lib/service.py | 114 +++++++++++++++++++-------------------- 3 files changed, 62 insertions(+), 62 deletions(-) diff --git a/addon.xml b/addon.xml index 2c35def3..86b5815d 100644 --- a/addon.xml +++ b/addon.xml @@ -1,5 +1,5 @@ - + @@ -61,10 +61,7 @@ http://trakt.tv https://github.com/trakt/script.trakt - - Improved id matching for different metadata providers - - Added various refactoring and testing - - Improve mathing for movies with the same name - - Moved to new language structure + - Use correct hook into kodi 18 icon.png fanart.jpg diff --git a/changelog.txt b/changelog.txt index 73fc3900..5a752ddc 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,3 +1,6 @@ +version 3.2.1 + - Use correct hook into kodi 18 + version 3.2.0 - Improved id matching for different metadata providers - Added various refactoring and testing diff --git a/resources/lib/service.py b/resources/lib/service.py index 7b26de71..b1b0f22e 100644 --- a/resources/lib/service.py +++ b/resources/lib/service.py @@ -371,7 +371,7 @@ def __init__(self, *args, **kwargs): logger.debug("[traktPlayer] Initalized.") # called when kodi starts playing a file - def onPlayBackStarted(self): + def onAVStarted(self): xbmc.sleep(1000) self.type = None self.id = None @@ -393,22 +393,22 @@ def onPlayBackStarted(self): if self.isPlayingVideo(): # get item data from json rpc activePlayers = kodiUtilities.kodiJsonRequest({"jsonrpc": "2.0", "method": "Player.GetActivePlayers", "id": 1}) - logger.debug("[traktPlayer] onPlayBackStarted() - activePlayers: %s" % activePlayers) + logger.debug("[traktPlayer] onAVStarted() - activePlayers: %s" % activePlayers) playerId = int(activePlayers[0]['playerid']) - logger.debug("[traktPlayer] onPlayBackStarted() - Doing Player.GetItem kodiJsonRequest") + logger.debug("[traktPlayer] onAVStarted() - Doing Player.GetItem kodiJsonRequest") result = kodiUtilities.kodiJsonRequest({'jsonrpc': '2.0', 'method': 'Player.GetItem', 'params': {'playerid': playerId}, 'id': 1}) if result: - logger.debug("[traktPlayer] onPlayBackStarted() - %s" % result) + logger.debug("[traktPlayer] onAVStarted() - %s" % result) # check for exclusion _filename = None try: _filename = self.getPlayingFile() except: - logger.debug("[traktPlayer] onPlayBackStarted() - Exception trying to get playing filename, player suddenly stopped.") + logger.debug("[traktPlayer] onAVStarted() - Exception trying to get playing filename, player suddenly stopped.") return if kodiUtilities.checkExclusion(_filename): - logger.debug("[traktPlayer] onPlayBackStarted() - '%s' is in exclusion settings, ignoring." % _filename) + logger.debug("[traktPlayer] onAVStarted() - '%s' is in exclusion settings, ignoring." % _filename) return self.type = result['item']['type'] @@ -421,7 +421,7 @@ def onPlayBackStarted(self): # check type of item if 'id' not in result['item']: # do a deeper check to see if we have enough data to perform scrobbles - logger.debug("[traktPlayer] onPlayBackStarted() - Started playing a non-library file, checking available data.") + logger.debug("[traktPlayer] onAVStarted() - Started playing a non-library file, checking available data.") season = xbmc.getInfoLabel('VideoPlayer.Season') episode = xbmc.getInfoLabel('VideoPlayer.Episode') @@ -443,7 +443,7 @@ def onPlayBackStarted(self): data['title'] = xbmc.getInfoLabel('VideoPlayer.Title') if year.isdigit(): data['year'] = int(year) - logger.debug("[traktPlayer] onPlayBackStarted() - Playing a non-library 'episode' - %s - S%02dE%02d - %s." % (data['showtitle'], data['season'], data['episode'], data['title'])) + logger.debug("[traktPlayer] onAVStarted() - Playing a non-library 'episode' - %s - S%02dE%02d - %s." % (data['showtitle'], data['season'], data['episode'], data['title'])) elif (year or video_ids) and not season and not showtitle: # we have a year or video_id and no season/showtitle info, enough for a movie self.type = 'movie' @@ -451,16 +451,16 @@ def onPlayBackStarted(self): if year.isdigit(): data['year'] = int(year) data['title'] = xbmc.getInfoLabel('VideoPlayer.Title') - logger.debug("[traktPlayer] onPlayBackStarted() - Playing a non-library 'movie' - %s (%s)." % (data['title'], data.get('year', 'NaN'))) + logger.debug("[traktPlayer] onAVStarted() - Playing a non-library 'movie' - %s (%s)." % (data['title'], data.get('year', 'NaN'))) elif showtitle: title, season, episode = utilities.regex_tvshow(showtitle) data['type'] = 'episode' data['season'] = season data['episode'] = episode data['title'] = data['showtitle'] = title - logger.debug("[traktPlayer] onPlayBackStarted() - Title: %s, showtitle: %s, season: %d, episode: %d" % (title, showtitle, season, episode)) + logger.debug("[traktPlayer] onAVStarted() - Title: %s, showtitle: %s, season: %d, episode: %d" % (title, showtitle, season, episode)) else: - logger.debug("[traktPlayer] onPlayBackStarted() - Non-library file, not enough data for scrobbling, skipping.") + logger.debug("[traktPlayer] onAVStarted() - Non-library file, not enough data for scrobbling, skipping.") return elif self.type == 'episode' or self.type == 'movie': @@ -470,17 +470,17 @@ def onPlayBackStarted(self): data['type'] = self.type if self.type == 'episode': - logger.debug("[traktPlayer] onPlayBackStarted() - Doing multi-part episode check.") + logger.debug("[traktPlayer] onAVStarted() - Doing multi-part episode check.") result = kodiUtilities.kodiJsonRequest({'jsonrpc': '2.0', 'method': 'VideoLibrary.GetEpisodeDetails', 'params': {'episodeid': self.id, 'properties': ['tvshowid', 'season', 'episode', 'file']}, 'id': 1}) if result: - logger.debug("[traktPlayer] onPlayBackStarted() - %s" % result) + logger.debug("[traktPlayer] onAVStarted() - %s" % result) tvshowid = int(result['episodedetails']['tvshowid']) season = int(result['episodedetails']['season']) currentfile = result['episodedetails']['file'] result = kodiUtilities.kodiJsonRequest({'jsonrpc': '2.0', 'method': 'VideoLibrary.GetEpisodes', 'params': {'tvshowid': tvshowid, 'season': season, 'properties': ['episode', 'file'], 'sort': {'method': 'episode'}}, 'id': 1}) if result: - logger.debug("[traktPlayer] onPlayBackStarted() - %s" % result) + logger.debug("[traktPlayer] onAVStarted() - %s" % result) # make sure episodes array exists in results if 'episodes' in result: multi = [] @@ -490,9 +490,9 @@ def onPlayBackStarted(self): if len(multi) > 1: data['multi_episode_data'] = multi data['multi_episode_count'] = len(multi) - logger.debug("[traktPlayer] onPlayBackStarted() - This episode is part of a multi-part episode.") + logger.debug("[traktPlayer] onAVStarted() - This episode is part of a multi-part episode.") else: - logger.debug("[traktPlayer] onPlayBackStarted() - This is a single episode.") + logger.debug("[traktPlayer] onAVStarted() - This is a single episode.") elif (kodiUtilities.getSettingAsBool('scrobble_mythtv_pvr') and self.type == 'unknown' and result['item']['label']): # If we have label/id but no show type, then this might be a PVR recording. @@ -501,33 +501,33 @@ def onPlayBackStarted(self): # and episode name in the VideoPlayer label. In v16, that's gone, but the Player.Filename infolabel # is populated with several interesting things. If these things change in future versions, uncommenting # this code will hopefully provide some useful info in the debug log. - #logger.debug("[traktPlayer] onPlayBackStarted() - TEMP Checking all videoplayer infolabels.") + #logger.debug("[traktPlayer] onAVStarted() - TEMP Checking all videoplayer infolabels.") #for il in ['VideoPlayer.Time','VideoPlayer.TimeRemaining','VideoPlayer.TimeSpeed','VideoPlayer.Duration','VideoPlayer.Title','VideoPlayer.TVShowTitle','VideoPlayer.Season','VideoPlayer.Episode','VideoPlayer.Genre','VideoPlayer.Director','VideoPlayer.Country','VideoPlayer.Year','VideoPlayer.Rating','VideoPlayer.UserRating','VideoPlayer.Votes','VideoPlayer.RatingAndVotes','VideoPlayer.mpaa','VideoPlayer.IMDBNumber','VideoPlayer.EpisodeName','VideoPlayer.PlaylistPosition','VideoPlayer.PlaylistLength','VideoPlayer.Cast','VideoPlayer.CastAndRole','VideoPlayer.Album','VideoPlayer.Artist','VideoPlayer.Studio','VideoPlayer.Writer','VideoPlayer.Tagline','VideoPlayer.PlotOutline','VideoPlayer.Plot','VideoPlayer.LastPlayed','VideoPlayer.PlayCount','VideoPlayer.VideoCodec','VideoPlayer.VideoResolution','VideoPlayer.VideoAspect','VideoPlayer.AudioCodec','VideoPlayer.AudioChannels','VideoPlayer.AudioLanguage','VideoPlayer.SubtitlesLanguage','VideoPlayer.StereoscopicMode','VideoPlayer.EndTime','VideoPlayer.NextTitle','VideoPlayer.NextGenre','VideoPlayer.NextPlot','VideoPlayer.NextPlotOutline','VideoPlayer.NextStartTime','VideoPlayer.NextEndTime','VideoPlayer.NextDuration','VideoPlayer.ChannelName','VideoPlayer.ChannelNumber','VideoPlayer.SubChannelNumber','VideoPlayer.ChannelNumberLabel','VideoPlayer.ChannelGroup','VideoPlayer.ParentalRating','Player.FinishTime','Player.FinishTime(format)','Player.Chapter','Player.ChapterCount','Player.Time','Player.Time(format)','Player.TimeRemaining','Player.TimeRemaining(format)','Player.Duration','Player.Duration(format)','Player.SeekTime','Player.SeekOffset','Player.SeekOffset(format)','Player.SeekStepSize','Player.ProgressCache','Player.Folderpath','Player.Filenameandpath','Player.StartTime','Player.StartTime(format)','Player.Title','Player.Filename']: # logger.debug("[traktPlayer] TEMP %s : %s" % (il, xbmc.getInfoLabel(il))) #for k,v in result.iteritems(): - # logger.debug("[traktPlayer] onPlayBackStarted() - result - %s : %s" % (k,v)) + # logger.debug("[traktPlayer] onAVStarted() - result - %s : %s" % (k,v)) #for k,v in result['item'].iteritems(): - # logger.debug("[traktPlayer] onPlayBackStarted() - result.item - %s : %s" % (k,v)) + # logger.debug("[traktPlayer] onAVStarted() - result.item - %s : %s" % (k,v)) # As of Kodi v17, many of the VideoPlayer labels are populated by the MythTV PVR addon, though sadly this # does not include IMDB number. That means we're still stuck using the show title/episode name to look up # IDs to feed to the scrobbler. Still, much easier than previous versions! foundShowName = xbmc.getInfoLabel('VideoPlayer.Title') - logger.debug("[traktPlayer] onPlayBackStarted() - Found VideoPlayer.Title: %s" % foundShowName) + logger.debug("[traktPlayer] onAVStarted() - Found VideoPlayer.Title: %s" % foundShowName) foundEpisodeName = xbmc.getInfoLabel('VideoPlayer.EpisodeName') - logger.debug("[traktPlayer] onPlayBackStarted() - Found VideoPlayer.EpisodeName: %s" % foundEpisodeName) + logger.debug("[traktPlayer] onAVStarted() - Found VideoPlayer.EpisodeName: %s" % foundEpisodeName) foundEpisodeYear = xbmc.getInfoLabel('VideoPlayer.Year') - logger.debug("[traktPlayer] onPlayBackStarted() - Found VideoPlayer.Year: %s" % foundEpisodeYear) + logger.debug("[traktPlayer] onAVStarted() - Found VideoPlayer.Year: %s" % foundEpisodeYear) foundSeason = xbmc.getInfoLabel('VideoPlayer.Season') - logger.debug("[traktPlayer] onPlayBackStarted() - Found VideoPlayer.Season: %s" % foundSeason) + logger.debug("[traktPlayer] onAVStarted() - Found VideoPlayer.Season: %s" % foundSeason) foundEpisode = xbmc.getInfoLabel('VideoPlayer.Episode') - logger.debug("[traktPlayer] onPlayBackStarted() - Found VideoPlayer.Episode: %s" % foundEpisode) + logger.debug("[traktPlayer] onAVStarted() - Found VideoPlayer.Episode: %s" % foundEpisode) if (foundShowName and foundEpisodeName and foundEpisodeYear): # If the show/episode/year are populated, we can skip all the mess of trying to extract the info from the # Player.Filename infolabel. - logger.debug("[traktPlayer] onPlayBackStarted() - Got info from VideoPlayer labels") + logger.debug("[traktPlayer] onAVStarted() - Got info from VideoPlayer labels") else: - logger.debug("[traktPlayer] onPlayBackStarted() - No love from VideoPlayer labels, trying Player.Filename infolabel") + logger.debug("[traktPlayer] onAVStarted() - No love from VideoPlayer labels, trying Player.Filename infolabel") # If that didn't work, we can fall back on the Player.Filename infolabel. It shows up like this: # (v16) ShowName [sXXeYY ](year) EpisodeName, channel, PVRFileName # (v17) ShowName [sXXeYY ](year) EpisodeName, channel, date, PVRFileName @@ -536,36 +536,36 @@ def onPlayBackStarted(self): # Powerless s01e08 (2017)%20Green%20Furious, TV%20(WOOD%20TV), 20170414_003000, 1081_1492129800_4e1.pvr # DC's Legends of Tomorrow (2016) Pilot, Part 2, TV (CW W MI), 20160129_010000, 1081_1492129800_4e1.pvr foundLabel = urllib.unquote(xbmc.getInfoLabel('Player.Filename')) - logger.debug("[traktPlayer] onPlayBackStarted() - Found unknown video type with label: %s. Might be a PVR episode, searching Trakt for it." % foundLabel) - logger.debug("[traktPlayer] onPlayBackStarted() - After urllib.unquote: %s." % foundLabel) + logger.debug("[traktPlayer] onAVStarted() - Found unknown video type with label: %s. Might be a PVR episode, searching Trakt for it." % foundLabel) + logger.debug("[traktPlayer] onAVStarted() - After urllib.unquote: %s." % foundLabel) splitLabel = foundLabel.rsplit(", ", 3) - logger.debug("[traktPlayer] onPlayBackStarted() - Post-split of label: %s " % splitLabel) + logger.debug("[traktPlayer] onAVStarted() - Post-split of label: %s " % splitLabel) if len(splitLabel) != 4: - logger.debug("[traktPlayer] onPlayBackStarted() - Label doesn't have the ShowName sXXeYY (year) EpisodeName, channel, date, PVRFileName format that was expected. Might be the v16 version with no date instead.") + logger.debug("[traktPlayer] onAVStarted() - Label doesn't have the ShowName sXXeYY (year) EpisodeName, channel, date, PVRFileName format that was expected. Might be the v16 version with no date instead.") splitLabel = foundLabel.rsplit(", ", 2) - logger.debug("[traktPlayer] onPlayBackStarted() - Post-split of label: %s " % splitLabel) + logger.debug("[traktPlayer] onAVStarted() - Post-split of label: %s " % splitLabel) if len(splitLabel) != 3: - logger.debug("[traktPlayer] onPlayBackStarted() - Label doesn't have the ShowName sXXeYY (year) EpisodeName, channel, PVRFileName format that was expected. Giving up.") + logger.debug("[traktPlayer] onAVStarted() - Label doesn't have the ShowName sXXeYY (year) EpisodeName, channel, PVRFileName format that was expected. Giving up.") return foundShowAndEpInfo = splitLabel[0] - logger.debug("[traktPlayer] onPlayBackStarted() - show plus episode info: %s" % foundShowAndEpInfo) + logger.debug("[traktPlayer] onAVStarted() - show plus episode info: %s" % foundShowAndEpInfo) splitShowAndEpInfo = re.split(' (s\d\de\d\d)? ?\((\d\d\d\d)\) ',foundShowAndEpInfo, 1) - logger.debug("[traktPlayer] onPlayBackStarted() - Post-split of show plus episode info: %s " % splitShowAndEpInfo) + logger.debug("[traktPlayer] onAVStarted() - Post-split of show plus episode info: %s " % splitShowAndEpInfo) if len(splitShowAndEpInfo) != 4: - logger.debug("[traktPlayer] onPlayBackStarted() - Show plus episode info doesn't have the ShowName sXXeYY (year) EpisodeName format that was expected. Giving up.") + logger.debug("[traktPlayer] onAVStarted() - Show plus episode info doesn't have the ShowName sXXeYY (year) EpisodeName format that was expected. Giving up.") return foundShowName = splitShowAndEpInfo[0] - logger.debug("[traktPlayer] onPlayBackStarted() - using show name: %s" % foundShowName) + logger.debug("[traktPlayer] onAVStarted() - using show name: %s" % foundShowName) foundEpisodeName = splitShowAndEpInfo[3] - logger.debug("[traktPlayer] onPlayBackStarted() - using episode name: %s" % foundEpisodeName) + logger.debug("[traktPlayer] onAVStarted() - using episode name: %s" % foundEpisodeName) foundEpisodeYear = splitShowAndEpInfo[2] - logger.debug("[traktPlayer] onPlayBackStarted() - using episode year: %s" % foundEpisodeYear) + logger.debug("[traktPlayer] onAVStarted() - using episode year: %s" % foundEpisodeYear) epYear = None try: epYear = int(foundEpisodeYear) except ValueError: epYear = None - logger.debug("[traktPlayer] onPlayBackStarted() - verified episode year: %d" % epYear) + logger.debug("[traktPlayer] onAVStarted() - verified episode year: %d" % epYear) # All right, now we have the show name, episode name, and (maybe) episode year. All good, but useless for # scrobbling since Trakt only understands IDs, not names. data['video_ids'] = None @@ -576,21 +576,21 @@ def onPlayBackStarted(self): # that we can't search for show and episode together, because the Trakt function gets confused and returns nothing. newResp = globals.traktapi.getTextQuery(foundEpisodeName, "episode", epYear) if not newResp: - logger.debug("[traktPlayer] onPlayBackStarted() - Empty Response from getTextQuery, giving up") + logger.debug("[traktPlayer] onAVStarted() - Empty Response from getTextQuery, giving up") else: - logger.debug("[traktPlayer] onPlayBackStarted() - Got Response from getTextQuery: %s" % str(newResp)) + logger.debug("[traktPlayer] onAVStarted() - Got Response from getTextQuery: %s" % str(newResp)) # We got something back. See if one of the returned values is for the show we're looking for. Often it's # not, but since there's no way to tell the search which show we want, this is all we can do. rightResp = None for thisResp in newResp: compareShowName = thisResp.show.title - logger.debug("[traktPlayer] onPlayBackStarted() - comparing show name: %s" % compareShowName) + logger.debug("[traktPlayer] onAVStarted() - comparing show name: %s" % compareShowName) if thisResp.show.title == foundShowName: - logger.debug("[traktPlayer] onPlayBackStarted() - found the right show, using this response") + logger.debug("[traktPlayer] onAVStarted() - found the right show, using this response") rightResp = thisResp break if rightResp is None: - logger.debug("[traktPlayer] onPlayBackStarted() - Failed to find matching episode/show via text search.") + logger.debug("[traktPlayer] onAVStarted() - Failed to find matching episode/show via text search.") else: # OK, now we have a episode object to work with. self.type = 'episode' @@ -611,12 +611,12 @@ def onPlayBackStarted(self): # This text query API is basically the same as searching on the website. Works with alternative # titles, unlike the scrobble function. Though we can't use the episode year since that would only # match the show if we're dealing with season 1. - logger.debug("[traktPlayer] onPlayBackStarted() - Searching for show title via getTextQuery: %s" % foundShowName) + logger.debug("[traktPlayer] onAVStarted() - Searching for show title via getTextQuery: %s" % foundShowName) newResp = globals.traktapi.getTextQuery(foundShowName, "show", None) if not newResp: - logger.debug("[traktPlayer] onPlayBackStarted() - Empty Show Response from getTextQuery, falling back on episode text query") + logger.debug("[traktPlayer] onAVStarted() - Empty Show Response from getTextQuery, falling back on episode text query") else: - logger.debug("[traktPlayer] onPlayBackStarted() - Got Show Response from getTextQuery: %s" % str(newResp)) + logger.debug("[traktPlayer] onAVStarted() - Got Show Response from getTextQuery: %s" % str(newResp)) # We got something back. Have to assume the first show found is the right one; if there's more than # one, there's no way to know which to use. Pull the ids from the show data, and store 'em for scrobbling. showKeys = { } @@ -626,18 +626,18 @@ def onPlayBackStarted(self): # Now to find the episode. There's no search function to look for an episode within a show, but # we can get all the episodes and look for the title. while (not data['season']): - logger.debug("[traktPlayer] onPlayBackStarted() - Querying for all seasons/episodes of this show") + logger.debug("[traktPlayer] onAVStarted() - Querying for all seasons/episodes of this show") epQueryResp = globals.traktapi.getShowWithAllEpisodesList(data['video_ids']['trakt']) if not epQueryResp: # Nothing returned. Giving up. - logger.debug("[traktPlayer] onPlayBackStarted() - No response received") + logger.debug("[traktPlayer] onAVStarted() - No response received") break; else: # Got the list back. Go through each season. - logger.debug("[traktPlayer] onPlayBackStarted() - Got response with seasons: %s" % str(epQueryResp)) + logger.debug("[traktPlayer] onAVStarted() - Got response with seasons: %s" % str(epQueryResp)) for eachSeason in epQueryResp: # For each season, check each episode. - logger.debug("[traktPlayer] onPlayBackStarted() - Processing season: %s" % str(eachSeason)) + logger.debug("[traktPlayer] onAVStarted() - Processing season: %s" % str(eachSeason)) for eachEpisodeNumber in eachSeason.episodes: thisEpTitle = None # Get the title. The try block is here in case the title doesn't exist for some entries. @@ -645,7 +645,7 @@ def onPlayBackStarted(self): thisEpTitle = eachSeason.episodes[eachEpisodeNumber].title except: thisEpTitle = None - logger.debug("[traktPlayer] onPlayBackStarted() - Checking episode number %d with title %s" % (eachEpisodeNumber, thisEpTitle)) + logger.debug("[traktPlayer] onAVStarted() - Checking episode number %d with title %s" % (eachEpisodeNumber, thisEpTitle)) if (foundEpisodeName == thisEpTitle): # Found it! Save the data. The scrobbler wants season and episode number. Which for some # reason is stored as a pair in the first item in the keys array. @@ -660,13 +660,13 @@ def onPlayBackStarted(self): # Now we've done all we can. if (data['season']): # OK, that's everything. Data should be all set for scrobbling. - logger.debug("[traktPlayer] onPlayBackStarted() - Playing a non-library 'episode' : show trakt key %s, season: %d, episode: %d" % (data['video_ids'], data['season'], data['episode'])) + logger.debug("[traktPlayer] onAVStarted() - Playing a non-library 'episode' : show trakt key %s, season: %d, episode: %d" % (data['video_ids'], data['season'], data['episode'])) else: # Still no data? Too bad, have to give up. - logger.debug("[traktPlayer] onPlayBackStarted() - Did our best, but couldn't get info for this show and episode. Skipping.") + logger.debug("[traktPlayer] onAVStarted() - Did our best, but couldn't get info for this show and episode. Skipping.") return; else: - logger.debug("[traktPlayer] onPlayBackStarted() - Video type '%s' unrecognized, skipping." % self.type) + logger.debug("[traktPlayer] onAVStarted() - Video type '%s' unrecognized, skipping." % self.type) return pl = xbmc.PlayList(xbmc.PLAYLIST_VIDEO) @@ -674,10 +674,10 @@ def onPlayBackStarted(self): if plSize > 1: pos = pl.getposition() if not self.plIndex is None: - logger.debug("[traktPlayer] onPlayBackStarted() - User manually skipped to next (or previous) video, forcing playback ended event.") + logger.debug("[traktPlayer] onAVStarted() - User manually skipped to next (or previous) video, forcing playback ended event.") self.onPlayBackEnded() self.plIndex = pos - logger.debug("[traktPlayer] onPlayBackStarted() - Playlist contains %d item(s), and is currently on item %d" % (plSize, (pos + 1))) + logger.debug("[traktPlayer] onAVStarted() - Playlist contains %d item(s), and is currently on item %d" % (plSize, (pos + 1))) self._playing = True