def startedWatching(self): scrobbleMovieOption = __settings__.getSetting("scrobble_movie") scrobbleEpisodeOption = __settings__.getSetting("scrobble_episode") if self.curVideo['type'] == 'movie' and scrobbleMovieOption == 'true': match = None if 'id' in self.curVideo: match = utilities.getMovieDetailsFromXbmc(self.curVideo['id'], ['imdbnumber', 'title', 'year']) elif 'title' in self.curVideoData and 'year' in self.curVideoData: match = {} match['imdbnumber'] = '' match['title'] = self.curVideoData['title'] match['year'] = self.curVideoData['year'] if match == None: return response = utilities.watchingMovieOnTrakt(match['imdbnumber'], match['title'], match['year'], self.totalTime/60, int(100*self.watchedTime/self.totalTime)) if response != None: Debug("[Scrobbler] Watch response: "+str(response)) elif self.curVideo['type'] == 'episode' and scrobbleEpisodeOption == 'true': match = None if 'id' in self.curVideo: match = utilities.getEpisodeDetailsFromXbmc(self.curVideo['id'], ['showtitle', 'season', 'episode', 'tvshowid', 'uniqueid']) elif 'showtitle' in self.curVideoData and 'season' in self.curVideoData and 'episode' in self.curVideoData: match = {} match['tvdb_id'] = None match['year'] = None match['showtitle'] = self.curVideoData['showtitle'] match['season'] = self.curVideoData['season'] match['episode'] = self.curVideoData['episode'] match['uniqueid'] = self.curVideoData['uniqueid']['unknown'] if match == None: return response = utilities.watchingEpisodeOnTrakt(match['tvdb_id'], match['showtitle'], match['year'], match['season'], match['episode'], match['uniqueid']['unknown'], self.totalTime/60, int(100*self.watchedTime/self.totalTime)) if response != None: Debug("[Scrobbler] Watch response: "+str(response))
def startedWatching(self): scrobbleMovieOption = __settings__.getSetting("scrobble_movie") scrobbleEpisodeOption = __settings__.getSetting("scrobble_episode") if self.curVideo['type'] == 'movie' and scrobbleMovieOption == 'true': match = None if 'id' in self.curVideo: match = utilities.getMovieDetailsFromXbmc( self.curVideo['id'], ['imdbnumber', 'title', 'year']) elif 'title' in self.curVideoData and 'year' in self.curVideoData: match = {} match['imdbnumber'] = '' match['title'] = self.curVideoData['title'] match['year'] = self.curVideoData['year'] if match == None: return response = utilities.watchingMovieOnTrakt( match['imdbnumber'], match['title'], match['year'], self.totalTime / 60, int(100 * self.watchedTime / self.totalTime)) if response != None: Debug("[Scrobbler] Watch response: " + str(response)) elif self.curVideo[ 'type'] == 'episode' and scrobbleEpisodeOption == 'true': match = None if 'id' in self.curVideo: match = utilities.getEpisodeDetailsFromXbmc( self.curVideo['id'], ['showtitle', 'season', 'episode', 'tvshowid', 'uniqueid']) elif 'showtitle' in self.curVideoData and 'season' in self.curVideoData and 'episode' in self.curVideoData: match = {} match['tvdb_id'] = None match['year'] = None match['showtitle'] = self.curVideoData['showtitle'] match['season'] = self.curVideoData['season'] match['episode'] = self.curVideoData['episode'] match['uniqueid'] = self.curVideoData['uniqueid']['unknown'] if match == None: return response = utilities.watchingEpisodeOnTrakt( match['tvdb_id'], match['showtitle'], match['year'], match['season'], match['episode'], match['uniqueid']['unknown'], self.totalTime / 60, int(100 * self.watchedTime / self.totalTime)) if response != None: Debug("[Scrobbler] Watch response: " + str(response))
def _started_watching(self): scrobble_movies = __settings__.getSetting("scrobble_movie") scrobble_episodes = __settings__.getSetting("scrobble_episode") if self._current_video['type'] == 'movie' and scrobble_movies == 'true': match = utilities.getMovieDetailsFromXbmc(self._current_video['id'], ['imdbnumber', 'title', 'year']) if match == None: return response = utilities.watchingMovieOnTrakt(match['imdbnumber'], match['title'], match['year'], self._total_time/60, int(100*self._watched_time/self._total_time)) if response != None: Debug("[Scrobbler] Watch response: "+str(response)) elif self._current_video['type'] == 'episode' and scrobble_episodes == 'true': match = utilities.getEpisodeDetailsFromXbmc(self._current_video['id'], ['showtitle', 'season', 'episode']) if match == None: return response = utilities.watchingEpisodeOnTrakt(None, match['showtitle'], None, match['season'], match['episode'], self._total_time/60, int(100*self._watched_time/self._total_time)) if response != None: Debug("[Scrobbler] Watch responce: "+str(response))
def startedWatching(self): scrobbleMovieOption = __settings__.getSetting("scrobble_movie") scrobbleEpisodeOption = __settings__.getSetting("scrobble_episode") ExcludeLiveTV = __settings__.getSetting("ExcludeLiveTV") ExcludeHTTP = __settings__.getSetting("ExcludeHTTP") ExcludePathOption = __settings__.getSetting("ExcludePathOption") ExcludePathOption2 = __settings__.getSetting("ExcludePathOption2") ExcludePathOption3 = __settings__.getSetting("ExcludePathOption3") ExcludePath = __settings__.getSetting("ExcludePath") ExcludePath2 = __settings__.getSetting("ExcludePath2") ExcludePath3 = __settings__.getSetting("ExcludePath3") LiveTVExcluded = False HTTPExcluded = False PathExcluded = False currentPath = xbmc.Player().getPlayingFile() if (currentPath.find("pvr://") > -1) and ExcludeLiveTV == 'true': Debug("Video is playing via Live TV, which is currently set as excluded location.", False) LiveTVExcluded = True if (currentPath.find("http://") > -1) and ExcludeHTTP == 'true': Debug("Video is playing via HTTP source, which is currently set as excluded location.", False) HTTPExcluded = True if ExcludePath != "" and ExcludePathOption == 'true': if (currentPath.find(ExcludePath) > -1): Debug('Video is playing from location, which is currently set as excluded path 1.', False) PathExcluded = True if ExcludePath2 != "" and ExcludePathOption2 == 'true': currentPath = xbmc.Player().getPlayingFile() if (currentPath.find(ExcludePath2) > -1): Debug('Video is playing from location, which is currently set as excluded path 2.', False) PathExcluded = True if ExcludePath3 != "" and ExcludePathOption3 == 'true': currentPath = xbmc.Player().getPlayingFile() if (currentPath.find(ExcludePath3) > -1): Debug('Video is playing from location, which is currently set as excluded path 3.', False) PathExcluded = True if (LiveTVExcluded or HTTPExcluded or PathExcluded): self.VideoExcluded = True Debug("Video from excluded location was detected. No scrobbling!", False) if self.curVideo['type'] == 'movie' and scrobbleMovieOption == 'true' and not self.VideoExcluded: match = None if 'id' in self.curVideo: match = utilities.getMovieDetailsFromXbmc(self.curVideo['id'], ['imdbnumber', 'title', 'year']) elif 'title' in self.curVideoData and 'year' in self.curVideoData: match = {} match['imdbnumber'] = '' match['title'] = self.curVideoData['title'] match['year'] = self.curVideoData['year'] if match == None: return response = utilities.watchingMovieOnTrakt(match['imdbnumber'], match['title'], match['year'], self.totalTime/60, int(100*self.watchedTime/self.totalTime)) if response != None: Debug("[Scrobbler] Watch response: "+str(response)) elif self.curVideo['type'] == 'episode' and scrobbleEpisodeOption == 'true' and not self.VideoExcluded: match = None if 'id' in self.curVideo: match = utilities.getEpisodeDetailsFromXbmc(self.curVideo['id'], ['showtitle', 'season', 'episode', 'tvshowid', 'uniqueid']) elif 'showtitle' in self.curVideoData and 'season' in self.curVideoData and 'episode' in self.curVideoData: match = {} match['tvdb_id'] = None match['year'] = None match['showtitle'] = self.curVideoData['showtitle'] match['season'] = self.curVideoData['season'] match['episode'] = self.curVideoData['episode'] match['uniqueid'] = self.curVideoData['uniqueid']['unknown'] if match == None: return response = utilities.watchingEpisodeOnTrakt(match['tvdb_id'], match['showtitle'], match['year'], match['season'], match['episode'], match['uniqueid']['unknown'], self.totalTime/60, int(100*self.watchedTime/self.totalTime)) if response != None: Debug("[Scrobbler] Watch response: "+str(response))