Beispiel #1
0
    def __init__(self, xml, fallback_path=__settings__.getAddonInfo('path'), defaultskinname="Default", forcefallback=False):
        super(RateDialog, self).__init__(xml, fallback_path, defaultskinname, forcefallback)

        self._id_to_rating_string = {
            RATE_LOVE_BTN: "love", RATE_HATE_BTN: "hate", RATE_ADVANCED_1_BTN: "1",
            RATE_ADVANCED_2_BTN: "2", RATE_ADVANCED_3_BTN: "3", RATE_ADVANCED_4_BTN: "4",
            RATE_ADVANCED_5_BTN: "5", RATE_ADVANCED_6_BTN: "6", RATE_ADVANCED_7_BTN: "7",
            RATE_ADVANCED_8_BTN: "8", RATE_ADVANCED_9_BTN: "9", RATE_ADVANCED_10_BTN: "10"
        }

        self._cur_rating = None
        self._control_id = None
        self._rating_type = utilities.getTraktRatingType()
Beispiel #2
0
def rate_movie(movieid=None, imdbid=None, title=None, year=None):
    """Launches the movie rating dialogue"""
    if movieid != None:
        match = utilities.getMovieDetailsFromXbmc(movieid, ['imdbnumber', 'title', 'year'])
        if not match:
            #add error message here
            return

        imdbid = match['imdbnumber']
        title = match['title']
        year = match['year']

    if utilities.getTraktRatingType() == "advanced":
        gui = windows.RateMovieDialog("rate_advanced.xml", __settings__.getAddonInfo('path'))
    else:
        gui = windows.RateMovieDialog("rate.xml", __settings__.getAddonInfo('path'))

    gui.initDialog(imdbid, title, year, utilities.getMovieRatingFromTrakt(imdbid, title, year))
    gui.doModal()
    del gui
Beispiel #3
0
def rate_episode(episode_id):
    """Launches the episode rating dialogue"""
    match = utilities.getEpisodeDetailsFromXbmc(episode_id, ['showtitle', 'season', 'episode'])
    if not match:
        #add error message here
        return

    tvdbid = None #match['tvdbnumber']
    title = match['showtitle']
    year = None #match['year']
    season = match['season']
    episode = match['episode']

    if utilities.getTraktRatingType() == "advanced":
        gui = windows.RateEpisodeDialog("rate_advanced.xml", __settings__.getAddonInfo('path'))
    else:
        gui = windows.RateEpisodeDialog("rate.xml", __settings__.getAddonInfo('path'))

    gui.initDialog(tvdbid, title, year, season, episode, utilities.getEpisodeRatingFromTrakt(tvdbid, title, year, season, episode))
    gui.doModal()
    del gui