Example #1
0
def render_listings(endpoint, default_title = None, return_response = False, cache_time = None):
    listings_endpoint = util.listings_endpoint(endpoint)

    response  = JSON.ObjectFromURL(listings_endpoint, cacheTime = cache_time)
    container = render_listings_response(response, endpoint = endpoint, default_title = default_title)

    if return_response:
        return [ container, response ]
    else:
        return container
Example #2
0
    def migrate():
        if 'favorites' in Dict:
            old_favorites = bridge.plex.user_dict()['favorites']
            new_favorites = bridge.favorite.collection()

            for endpoint, title in old_favorites.iteritems():
                if endpoint not in new_favorites:
                    try:
                        response = JSON.ObjectFromURL(util.listings_endpoint(endpoint))
                        bridge.favorite.append(endpoint = endpoint, title = response['display_title'], artwork = response['artwork'])
                    except Exception, e:
                        #util.print_exception(e)
                        pass

            del Dict['favorites']
            bridge.plex.user_dict().Save()