Ejemplo n.º 1
0
def showTrendingMovies():

    movies = getTrendingMoviesFromTrakt()
    watchlist = traktMovieListByImdbID(getWatchlistMoviesFromTrakt())

    if movies == None:  # movies = None => there was an error
        return  # error already displayed in utilities.py

    if len(movies) == 0:
        xbmcgui.Dialog().ok("Trakt Utilities", "there are no trending movies")
        return

    for movie in movies:
        if movie['imdb_id'] in watchlist:
            movie['watchlist'] = True
        else:
            movie['watchlist'] = False

    # display trending movie list
    import windows
    ui = windows.MoviesWindow("movies.xml", __settings__.getAddonInfo('path'),
                              "Default")
    ui.initWindow(movies, 'trending')
    ui.doModal()
    del ui
Ejemplo n.º 2
0
def showRecommendedMovies():

    movies = getRecommendedMoviesFromTrakt()
    watchlist = traktMovieListByImdbID(getWatchlistMoviesFromTrakt())

    if movies == None:  # movies = None => there was an error
        return  # error already displayed in utilities.py

    if len(movies) == 0:
        xbmcgui.Dialog().ok(
            __language__(1201).encode("utf-8", "ignore"),
            __language__(1158).encode("utf-8", "ignore")
        )  # Trakt Utilities, there are no movies recommended for you
        return

    for movie in movies:
        if movie['imdb_id'] in watchlist:
            movie['watchlist'] = True
        else:
            movie['watchlist'] = False

    # display recommended movies list
    import windows
    ui = windows.MoviesWindow("movies.xml", __settings__.getAddonInfo('path'),
                              "Default")
    ui.initWindow(movies, 'recommended')
    ui.doModal()
    del ui
Ejemplo n.º 3
0
def showWatchlistMovies():

    movies = getWatchlistMoviesFromTrakt()

    if movies == None:  # movies = None => there was an error
        return  # error already displayed in utilities.py

    if len(movies) == 0:
        xbmcgui.Dialog().ok(
            __language__(1201).encode("utf-8", "ignore"),
            __language__(1160).encode("utf-8", "ignore")
        )  # Trakt Utilities, there are no movies in your watchlist
        return

    # display watchlist movie list
    import windows
    ui = windows.MoviesWindow("movies.xml", __settings__.getAddonInfo('path'),
                              "Default")
    ui.initWindow(movies, 'watchlist')
    ui.doModal()
    del ui