def watchlist_tv():
    """Create TV show watchlist window"""
    tvshows = utilities.getWatchlistTVShowsFromTrakt()

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

    if len(tvshows) == 0:
        xbmcgui.Dialog().ok(_(200), _(135))
        return

    _create_window('watchlist', tvshows, _WINDOW_TYPE_TV)
def trending_tv():
    """Create trending shows window"""
    tvshows = utilities.getTrendingTVShowsFromTrakt()
    watchlist = utilities.traktShowListByTvdbID(utilities.getWatchlistTVShowsFromTrakt())

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

    if len(tvshows) == 0:
        xbmcgui.Dialog().ok(_(200), _(161))
        return

    for tvshow in tvshows:
        if tvshow['imdb_id'] in watchlist:
            tvshow['watchlist'] = True
        else:
            tvshow['watchlist'] = False

    _create_window('trending', tvshows, _WINDOW_TYPE_TV)