Exemple #1
0
	def scrobble(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.scrobbleMovieOnTrakt(match['imdbnumber'], match['title'], match['year'], self.totalTime/60, int(100*self.watchedTime/self.totalTime))
			if response != None:
				Debug("[Scrobbler] Scrobble 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.scrobbleEpisodeOnTrakt(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] Scrobble response: "+str(response))
Exemple #2
0
    def scrobble(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.scrobbleMovieOnTrakt(
                match['imdbnumber'], match['title'], match['year'],
                self.totalTime / 60,
                int(100 * self.watchedTime / self.totalTime))
            if response != None:
                Debug("[Scrobbler] Scrobble 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.scrobbleEpisodeOnTrakt(
                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] Scrobble response: " + str(response))
    def _scrobble(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.scrobbleMovieOnTrakt(match['imdbnumber'], match['title'], match['year'], self._total_time/60, int(100*self._watched_time/self._total_time))
            if response != None:
                Debug("[Scrobbler] Scrobble responce: "+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.scrobbleEpisodeOnTrakt(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] Scrobble responce: "+str(response))