Exemplo n.º 1
0
def my_music():
    add_directory(_T(30213), user_playlists)
    add_directory(_T(30214), plugin.url_for(favorites, content_type='artists'))
    add_directory(_T(30215), plugin.url_for(favorites, content_type='albums'))
    add_directory(_T(30216), plugin.url_for(favorites, content_type='playlists'))
    add_directory(_T(30217), plugin.url_for(favorites, content_type='tracks'))
    add_directory(_T(30218), plugin.url_for(favorites, content_type='videos'), end=True)
Exemplo n.º 2
0
def root():
    if session.is_logged_in:
        add_directory(_T(30201), my_music)
    add_directory(_T(30202), featured_playlists)
    categories = Category.groups()
    for item in categories:
        add_directory(_T(item), plugin.url_for(category, group=item))
    add_directory(_T(30206), search)
    if session.is_logged_in:
        add_directory(_T(30207), logout, end=True, isFolder=False)
    else:
        add_directory(_T(30208), login, end=True, isFolder=False)
Exemplo n.º 3
0
def artist_view(artist_id):
    if session.is_logged_in:
        session.user.favorites.load_all()
    artist = session.get_artist(artist_id)
    xbmcplugin.setContent(plugin.handle, 'albums')
    add_directory(_T(30225), plugin.url_for(artist_bio, artist_id), thumb=artist.image, fanart=artist.fanart)
    add_directory(_T(30226), plugin.url_for(top_tracks, artist_id), thumb=artist.image, fanart=artist.fanart)
    add_directory(_P('videos'), plugin.url_for(artist_videos, artist_id), thumb=artist.image, fanart=artist.fanart)
    add_directory(_T(30227), plugin.url_for(artist_radio, artist_id), thumb=artist.image, fanart=artist.fanart)
    add_directory(_T(30228), plugin.url_for(artist_playlists, artist_id), thumb=artist.image, fanart=artist.fanart)
    add_directory(_T(30229), plugin.url_for(similar_artists, artist_id), thumb=artist.image, fanart=artist.fanart)
    if session.is_logged_in:
        if session.user.favorites.isFavoriteArtist(artist_id):
            add_directory(_T(30220), plugin.url_for(favorites_remove, content_type='artists', item_id=artist_id), thumb=artist.image, fanart=artist.fanart)
        else:
            add_directory(_T(30219), plugin.url_for(favorites_add, content_type='artists', item_id=artist_id), thumb=artist.image, fanart=artist.fanart)
    albums = session.get_artist_albums(artist_id) + \
             session.get_artist_albums_ep_singles(artist_id) + \
             session.get_artist_albums_other(artist_id)
    add_items(albums, content=None)
Exemplo n.º 4
0
def category(group):
    promoGroup = {'rising': 'RISING', 'discovery': 'DISCOVERY', 'featured': 'NEWS'}.get(group, None)
    items = session.get_category_items(group)
    totalCount = 0
    for item in items:
        totalCount += len(item.content_types)
    if totalCount == 1:
        # Show Single content directly (Movies and TV Shows)
        for item in items:
            content_types = item.content_types
            for content_type in content_types:
                category_content(group, item.path, content_type, offset=0)
                return
    xbmcplugin.setContent(plugin.handle, 'files')
    if promoGroup and totalCount > 10:
        # Add Promotions as Folder on the Top if more than 10 Promotions available
        add_directory(_T(30202), plugin.url_for(featured, group=promoGroup))
    # Add Category Items as Folders
    add_items(items, content=None, end=not(promoGroup and totalCount <= 10))
    if promoGroup and totalCount <= 10:
        # Show up to 10 Promotions as single Items
        promoItems = session.get_featured(promoGroup, types=['ALBUM', 'PLAYLIST', 'VIDEO'])
        if promoItems:
            add_items(promoItems, end=True)
Exemplo n.º 5
0
def search():
    add_directory(_T(30106), plugin.url_for(search_type, field='artist'))
    add_directory(_T(30107), plugin.url_for(search_type, field='album'))
    add_directory(_T(30108), plugin.url_for(search_type, field='playlist'))
    add_directory(_T(30109), plugin.url_for(search_type, field='track'))
    add_directory(_T(30110), plugin.url_for(search_type, field='video'), end=True)