def diary(username, page): # Content type plugin.set_content('movies') # Items films, next_page = letterboxd.get_diary(username, page) items = [{ 'icon':film['poster'], 'thumbnail':film['poster'], 'label':'%s (%s)' % (film['title'], film['year']), 'info': { 'genre': 'Date: %s | Rating: %s | Liked: %s | Rewatch: %s' % (film['date'], film['rating'], film['liked'], film['rewatch']), 'rating': (float(film['rating']) * 2) }, 'context_menu': context_menus.film(film['title']), 'replace_context_menu': True, 'path':plugin.url_for('index') } for film in films] # Pagination items = _pagination(items, page, next_page, route='diary', options={'username':username}) # Return return items
def list(username, slug, page): # Content type plugin.set_content('movies') # Items label = '%s (%s)' label_ranked = '[COLOR yellow]%s.[/COLOR] ' + label films, next_page = letterboxd.get_list(username, slug, page) items = [{ 'icon': film['poster'], 'thumbnail': film['poster'], 'label': label_ranked % (film['pos'], film['title'], film['year']) if film['pos'] else label % (film['title'], film['year']), 'info': { 'genre': 'test, foo, bar', 'playcount': 1 if film['watched'] else 0 }, 'context_menu': context_menus.film(film['title']), 'replace_context_menu': True, 'path': plugin.url_for('index') } for film in films] # Pagination items = _pagination(items, page, next_page, route='list', options={'username':username, 'slug':slug}) # Return return plugin.finish(items, update_listing=True)
def films(url, page): # Content type plugin.set_content('movies') # Items films, next_page = letterboxd.get_films(url, page) items = [{ 'icon': film['poster'], 'thumbnail': film['poster'], 'label': '%s (%s)' % (film['title'], film['year']), 'info': { 'genre': 'test, foo, bar' }, 'context_menu': context_menus.film(film['title']), 'replace_context_menu': True, 'path': plugin.url_for('index') } for film in films] # Pagination items = _pagination(items, page, next_page, route='films', options={'url':url}) # Return return plugin.finish(items, update_listing=True)