Esempio n. 1
0
def add_station(station):
    log_debug("add_station", 2)
    log_debug("station: %s" % station, 3)

    id = utils.get_value(station, "guide_id")
    name = utils.get_value(station, "name")
    logo = utils.get_value(station, "logo")
    label = utils.get_value(station, "slogan")
    genre = utils.get_value(station, "genre_name")
    if len(genre) == 0:
        genre = get_genre_name(utils.get_value(station, "genre_id"))

    if not __tunein__.is_station_id(id):
        return

    contextmenu = [
        (
            __settings__.get_string(1018),
            "XBMC.RunPlugin(%s)"
            % (
                utils.add_params(
                    __settings__.get_argv(0), {"path": "xbmc-favourites", "id": id, "name": name, "logo": logo}
                )
            ),
        )
    ]

    url = utils.add_params(__settings__.get_argv(0), {"path": "tune", "id": id, "name": name, "logo": logo})
    add_directory_item(name, url, label=label, genre=genre, logo=logo, isfolder=False, contextmenu=contextmenu)
Esempio n. 2
0
def add_station_outline(station):
    log_debug('add_station_outline', 2)
    log_debug('station: %s' % station, 3)

    id = utils.get_value(station, 'guide_id')
    name = utils.get_value(station, 'text')
    logo = utils.get_value(station, 'image')
    label = utils.get_value(station, 'subtext')
    album = utils.get_value(station, 'current_track')
    is_preset = utils.get_value(station, 'is_preset')
    preset_number = utils.get_value(station, 'preset_number')
    genre = utils.get_value(station, 'genre_name')
    if len(genre) == 0:
        genre = get_genre_name(utils.get_value(station, 'genre_id'))

    if not __tunein__.is_station_id(id):
        return

    url = utils.add_params(__settings__.get_argv(
        0), {'path': 'tune', 'id': id, 'name': name, 'logo': logo})

    if is_preset == 'true':
        contextmenu = [(
            __settings__.get_string(
                1012), 'XBMC.RunPlugin(%s?path=%s&id=%s&num=%s)' % (__settings__.get_argv(0), 'up', id, preset_number, )),
            (__settings__.get_string(1013), 'XBMC.RunPlugin(%s?path=%s&id=%s&num=%s)' %
             (__settings__.get_argv(0), 'down', id, preset_number, )),
            (__settings__.get_string(1005), 'XBMC.RunPlugin(%s?path=%s&id=%s)' % (__settings__.get_argv(0), 'remove', id))]
    else:
        contextmenu = [(__settings__.get_string(
            1004), 'XBMC.RunPlugin(%s?path=%s&id=%s)' % (__settings__.get_argv(0), 'add', id))]

    contextmenu.append((__settings__.get_string(1018), 'XBMC.RunPlugin(%s)' % (utils.add_params(__settings__.get_argv(0), {'path': 'xbmc-favourites', 'id': id, 'name': name, 'logo': logo}))))
    add_directory_item(name, url, album, artist=label, album=name, genre=genre,
                       logo=logo, isfolder=False, contextmenu=contextmenu)
Esempio n. 3
0
def add_station_outline(station):
    log_debug("add_station_outline", 2)
    log_debug("station: %s" % station, 3)

    id = utils.get_value(station, "guide_id")
    name = utils.get_value(station, "text")
    logo = utils.get_value(station, "image")
    label = utils.get_value(station, "subtext")
    album = utils.get_value(station, "current_track")
    is_preset = utils.get_value(station, "is_preset")
    preset_number = utils.get_value(station, "preset_number")
    genre = utils.get_value(station, "genre_name")
    if len(genre) == 0:
        genre = get_genre_name(utils.get_value(station, "genre_id"))

    if not __tunein__.is_station_id(id):
        return

    url = utils.add_params(__settings__.get_argv(0), {"path": "tune", "id": id, "name": name, "logo": logo})

    if is_preset == "true":
        contextmenu = [
            (
                __settings__.get_string(1012),
                "XBMC.RunPlugin(%s?path=%s&id=%s&num=%s)" % (__settings__.get_argv(0), "up", id, preset_number),
            ),
            (
                __settings__.get_string(1013),
                "XBMC.RunPlugin(%s?path=%s&id=%s&num=%s)" % (__settings__.get_argv(0), "down", id, preset_number),
            ),
            (
                __settings__.get_string(1005),
                "XBMC.RunPlugin(%s?path=%s&id=%s)" % (__settings__.get_argv(0), "remove", id),
            ),
        ]
    else:
        contextmenu = [
            (__settings__.get_string(1004), "XBMC.RunPlugin(%s?path=%s&id=%s)" % (__settings__.get_argv(0), "add", id))
        ]

    contextmenu.append(
        (
            __settings__.get_string(1018),
            "XBMC.RunPlugin(%s)"
            % (
                utils.add_params(
                    __settings__.get_argv(0), {"path": "xbmc-favourites", "id": id, "name": name, "logo": logo}
                )
            ),
        )
    )
    add_directory_item(
        name, url, album, artist=label, album=name, genre=genre, logo=logo, isfolder=False, contextmenu=contextmenu
    )
Esempio n. 4
0
def add_show_outline(show):
	log_debug('add_show_outline', 2)
	log_debug('show: %s' % show, 3)
	
	id = utils.get_value(show, 'guide_id')
	name = utils.get_value(show, 'text')
	logo = utils.get_value(show, 'image')
	label = utils.get_value(show, 'subtext')
	album = utils.get_value(show, 'current_track')
	is_preset = utils.get_value(show, 'is_preset')
	preset_number = utils.get_value(show, 'preset_number')
	
	params = utils.get_params(show['URL'].split('?')[1])
	category = utils.get_value(params, 'c')
	filter = utils.get_value(params, 'filter')
	
	if not __tunein__.is_show_id(id):
		return
	
	__showscache__.add(show)
	
	url = utils.add_params(__settings__.get_argv(0), {'path': 'tune-show', 'id': id, 'name': name, 'logo': logo, 'c': category, 'filter': filter})
	
	if is_preset == 'true':
		contextmenu = [(__settings__.get_string(1012), 'XBMC.RunPlugin(%s?path=%s&id=%s&num=%s)' % (__settings__.get_argv(0), 'up', id, preset_number, )), 
					   (__settings__.get_string(1013), 'XBMC.RunPlugin(%s?path=%s&id=%s&num=%s)' % (__settings__.get_argv(0), 'down', id, preset_number,)), 
					   (__settings__.get_string(1010), 'XBMC.RunPlugin(%s?path=%s&id=%s)' % (__settings__.get_argv(0), 'remove', id, ))]
	else:
		contextmenu = [(__settings__.get_string(1009), 'XBMC.RunPlugin(%s?path=%s&id=%s)' % (__settings__.get_argv(0), 'add', id, ))]

	add_directory_item(name, url, label=label, album=album, logo=logo, contextmenu=contextmenu)
Esempio n. 5
0
def add_link_outline(link):
    log_debug('add_link_outline', 2)
    log_debug('link: %s' % link, 3)

    if __tunein__.is_custom_url_id(utils.get_value(link, 'guide_id')):
        add_custom_url(link)
        return

    params = utils.get_params(link['URL'].split('?')[1])
    category = utils.get_value(params, 'c')
    offset = utils.get_value(params, 'offset')
    filter = utils.get_value(params, 'filter')
    pivot = utils.get_value(params, 'pivot')
    id = utils.get_value(params, 'id')
    name = utils.get_value(link, 'text')
    logo = ''

    if 'image' in link:
        logo = utils.get_value(link, 'image')
    label = ''
    if 'subtext' in link:
        label = utils.get_value(link, 'subtext')

    path = 'browse'
    if __tunein__.is_show_id(id):
        path = 'tune-show'
        contextmenu = [(__settings__.get_string(1009), 'XBMC.RunPlugin(%s?path=%s&id=%s)' %
                    (__settings__.get_argv(0), 'add', id, ))]
    else:
        contextmenu = []

    url = utils.add_params(__settings__.get_argv(0), {
                           'path': path, 'id': id, 'c': category, 'name': name, 'filter': filter, 'offset': offset, 'pivot': pivot})

    add_directory_item(name, url, label=label, logo=logo, contextmenu=contextmenu)
Esempio n. 6
0
def add_topic(topic, file=""):
    log_debug("add_topic", 2)
    log_debug("topic: %s" % topic, 3)
    log_debug("file: %s" % file, 3)

    id = utils.get_value(topic, "guide_id")
    name = utils.get_value(topic, "title")
    stream_type = utils.get_value(topic, "stream_type")

    if not __tunein__.is_topic_id(id):
        return

    if not __enabledownloads__ and stream_type == "download":
        return

    url = utils.add_params(__settings__.get_argv(0), {"path": "tune", "id": id, "name": name, "file": file})

    logo = None
    contextmenu = None
    if file is not None and len(file) > 0:
        contextmenu = [
            (
                __settings__.get_string(1016),
                "XBMC.RunPlugin(%s?path=%s&id=%s)" % (__settings__.get_argv(0), "remove-download", id),
            )
        ]
    if stream_type == "download":
        logo = __settings__.get_path("%s%s%s" % ("resources/images/", get_logo_colour(), "/downloads-256.png"))

    add_directory_item(name, url, logo=logo, isfolder=False, contextmenu=contextmenu)
Esempio n. 7
0
def add_topic(topic, file=''):
    log_debug('add_topic', 2)
    log_debug('topic: %s' % topic, 3)
    log_debug('file: %s' % file, 3)

    id = utils.get_value(topic, 'guide_id')
    name = utils.get_value(topic, 'title')
    stream_type = utils.get_value(topic, 'stream_type')

    if not __tunein__.is_topic_id(id):
        return

    if not __enabledownloads__ and stream_type == 'download':
        return

    url = utils.add_params(__settings__.get_argv(
        0), {'path': 'tune', 'id': id, 'name': name, 'file': file})

    logo = None
    contextmenu = None
    if file is not None and len(file) > 0:
        contextmenu = [(__settings__.get_string(1016), 'XBMC.RunPlugin(%s?path=%s&id=%s)' % (
            __settings__.get_argv(0), 'remove-download', id))]
    if stream_type == 'download':
        logo = __settings__.get_path('%s%s%s' % (
            'resources/images/', get_logo_colour(), '/downloads-256.png'))

    add_directory_item(
        name, url, logo=logo, isfolder=False, contextmenu=contextmenu)
Esempio n. 8
0
def add_topic_outline(topic):
    log_debug("add_topic_outline", 2)
    log_debug("topic: %s" % topic, 3)

    id = utils.get_value(topic, "guide_id")
    name = utils.get_value(topic, "text")
    subtext = utils.get_value(topic, "subtext")
    stream_type = utils.get_value(topic, "stream_type")

    params = utils.get_params(topic["URL"].split("?")[1])
    show_id = utils.get_value(params, "sid")

    if not __tunein__.is_topic_id(id):
        return

    if not __enabledownloads__ and stream_type == "download":
        return

    artist = ""
    comment = ""
    genre = ""
    album = ""
    for show in __showscache__.get():
        if "guide_id" in show and show["guide_id"] == show_id:
            artist = utils.get_value(show, "text")
            if len(artist) == 0:
                artist = utils.get_value(show, "hosts")
            album = utils.get_value(show, "title")
            comment = utils.get_value(show, "subtext")
            if len(comment) == 0:
                comment = utils.get_value(show, "description")
            genre = get_genre_name(utils.get_value(show, "genre_id"))
            break

    url = utils.add_params(__settings__.get_argv(0), {"path": "tune", "id": id, "name": name})

    logo = None
    contextmenu = None
    if stream_type == "download":
        contextmenu = [
            (
                __settings__.get_string(1014),
                "XBMC.RunPlugin(%s?path=%s&id=%s)" % (__settings__.get_argv(0), "download", id),
            )
        ]
        logo = __settings__.get_path("%s%s%s" % ("resources/images/", get_logo_colour(), "/downloads-256.png"))

    add_directory_item(
        name,
        url,
        label=subtext,
        artist=artist,
        album=album,
        comment=comment,
        genre=genre,
        logo=logo,
        isfolder=False,
        contextmenu=contextmenu,
    )
Esempio n. 9
0
def add_station(station):
    log_debug('add_station', 2)
    log_debug('station: %s' % station, 3)

    id = utils.get_value(station, 'guide_id')
    name = utils.get_value(station, 'name')
    logo = utils.get_value(station, 'logo')
    label = utils.get_value(station, 'slogan')
    genre = utils.get_value(station, 'genre_name')
    if len(genre) == 0:
        genre = get_genre_name(utils.get_value(station, 'genre_id'))

    if not __tunein__.is_station_id(id):
        return

    contextmenu = [(__settings__.get_string(1018), 'XBMC.RunPlugin(%s)' % (utils.add_params(__settings__.get_argv(0), {'path': 'xbmc-favourites', 'id': id, 'name': name, 'logo': logo})))]

    url = utils.add_params(__settings__.get_argv(
        0), {'path': 'tune', 'id': id, 'name': name, 'logo': logo})
    add_directory_item(
        name, url, label=label, genre=genre, logo=logo, isfolder=False, contextmenu=contextmenu)
Esempio n. 10
0
def add_show_outline(show):
    log_debug("add_show_outline", 2)
    log_debug("show: %s" % show, 3)

    id = utils.get_value(show, "guide_id")
    name = utils.get_value(show, "text")
    logo = utils.get_value(show, "image")
    label = utils.get_value(show, "subtext")
    album = utils.get_value(show, "current_track")
    is_preset = utils.get_value(show, "is_preset")
    preset_number = utils.get_value(show, "preset_number")

    params = utils.get_params(show["URL"].split("?")[1])
    category = utils.get_value(params, "c")
    filter = utils.get_value(params, "filter")

    if not __tunein__.is_show_id(id):
        return

    __showscache__.add(show)

    url = utils.add_params(
        __settings__.get_argv(0),
        {"path": "tune-show", "id": id, "name": name, "logo": logo, "c": category, "filter": filter},
    )

    if is_preset == "true":
        contextmenu = [
            (
                __settings__.get_string(1012),
                "XBMC.RunPlugin(%s?path=%s&id=%s&num=%s)" % (__settings__.get_argv(0), "up", id, preset_number),
            ),
            (
                __settings__.get_string(1013),
                "XBMC.RunPlugin(%s?path=%s&id=%s&num=%s)" % (__settings__.get_argv(0), "down", id, preset_number),
            ),
            (
                __settings__.get_string(1010),
                "XBMC.RunPlugin(%s?path=%s&id=%s)" % (__settings__.get_argv(0), "remove", id),
            ),
        ]
    else:
        contextmenu = [
            (__settings__.get_string(1009), "XBMC.RunPlugin(%s?path=%s&id=%s)" % (__settings__.get_argv(0), "add", id))
        ]

    add_directory_item(name, url, label=label, album=album, logo=logo, contextmenu=contextmenu)
Esempio n. 11
0
def add_topic_outline(topic):
    log_debug('add_topic_outline', 2)
    log_debug('topic: %s' % topic, 3)

    id = utils.get_value(topic, 'guide_id')
    name = utils.get_value(topic, 'text')
    subtext = utils.get_value(topic, 'subtext')
    stream_type = utils.get_value(topic, 'stream_type')

    params = utils.get_params(topic['URL'].split('?')[1])
    show_id = utils.get_value(params, 'sid')

    if not __tunein__.is_topic_id(id):
        return

    if not __enabledownloads__ and stream_type == 'download':
        return

    artist = ''
    comment = ''
    genre = ''
    album = ''
    for show in __showscache__.get():
        if 'guide_id' in show and show['guide_id'] == show_id:
            artist = utils.get_value(show, 'text')
            if len(artist) == 0:
                artist = utils.get_value(show, 'hosts')
            album = utils.get_value(show, 'title')
            comment = utils.get_value(show, 'subtext')
            if len(comment) == 0:
                comment = utils.get_value(show, 'description')
            genre = get_genre_name(utils.get_value(show, 'genre_id'))
            break

    url = utils.add_params(
        __settings__.get_argv(0), {'path': 'tune', 'id': id, 'name': name})

    logo = None
    contextmenu = None
    if stream_type == 'download':
        contextmenu = [(__settings__.get_string(1014), 'XBMC.RunPlugin(%s?path=%s&id=%s)' % (
            __settings__.get_argv(0), 'download', id))]
        logo = __settings__.get_path('%s%s%s' % (
            'resources/images/', get_logo_colour(), '/downloads-256.png'))

    add_directory_item(name, url, label=subtext, artist=artist, album=album,
                       comment=comment, genre=genre, logo=logo, isfolder=False, contextmenu=contextmenu)
Esempio n. 12
0
def add_custom_url(link, presets=True):
	log_debug('add_custom_url', 2)
	log_debug('link: %s' % link, 3)
	
	if not __tunein__.is_custom_url_id(utils.get_value(link, 'guide_id')):
		return
	
	id = utils.get_value(link, 'guide_id')
	url = utils.get_value(link, 'URL')
	name = utils.get_value(link, 'text')
	logo = utils.get_value(link, 'image')
	path = 'custom-url'
	contextmenu = None
	if presets:
		contextmenu = [(__settings__.get_string(1017), 'XBMC.RunPlugin(%s?path=%s&id=%s)' % (__settings__.get_argv(0), 'remove', id, ))]	
	url = utils.add_params(__settings__.get_argv(0), {'path': path, 'id': id, 'name': name, 'url': url, 'logo': logo})
	add_directory_item(name, url, logo=logo, contextmenu=contextmenu, isfolder=False)	
Esempio n. 13
0
def add_station(station):
	log_debug('add_station', 2)
	log_debug('station: %s' % station, 3)
	
	id = utils.get_value(station, 'guide_id')
	name = utils.get_value(station, 'name')
	logo = utils.get_value(station, 'logo')
	label = utils.get_value(station, 'slogan')
	genre = utils.get_value(station, 'genre_name')
	if len(genre) == 0:
		genre = get_genre_name(utils.get_value(station, 'genre_id'))
	
	if not __tunein__.is_station_id(id):
		return

	url = utils.add_params(__settings__.get_argv(0), {'path': 'tune', 'id': id, 'name': name, 'logo': logo})
	add_directory_item(name, url, label=label, genre=genre, logo=logo, isfolder=False)
Esempio n. 14
0
def add_show(show):
	log_debug('add_show', 2)
	log_debug('show: %s' % show, 3)

	id = utils.get_value(show, 'guide_id')
	name = utils.get_value(show, 'title')
	logo = utils.get_value(show, 'logo')
	label = utils.get_value(show, 'description')
	genre = utils.get_value(show, 'genre_name')
	if len(genre) == 0:
		genre = get_genre_name(utils.get_value(show, 'genre_id'))
	
	if not __tunein__.is_show_id(id):
		return
	
	__showscache__.add(show)
	
	url = utils.add_params(__settings__.get_argv(0), {'path': 'tune-show', 'id': id, 'name': name, 'logo': logo})
	contextmenu = [(__settings__.get_string(1009), 'XBMC.RunPlugin(%s?path=%s&id=%s)' % (__settings__.get_argv(0), 'add', id, ))]	
	add_directory_item(name, url, label=label, genre=genre, logo=logo, contextmenu=contextmenu)
Esempio n. 15
0
def add_custom_url(link, presets=True):
    log_debug('add_custom_url', 2)
    log_debug('link: %s' % link, 3)

    if not __tunein__.is_custom_url_id(utils.get_value(link, 'guide_id')):
        return

    id = utils.get_value(link, 'guide_id')
    url = utils.get_value(link, 'URL')
    name = utils.get_value(link, 'text')
    logo = utils.get_value(link, 'image')
    path = 'custom-url'
    contextmenu = None
    if presets:
        contextmenu = [(__settings__.get_string(1017), 'XBMC.RunPlugin(%s?path=%s&id=%s)' % (
            __settings__.get_argv(0), 'remove', id, ))]
    url = utils.add_params(__settings__.get_argv(
        0), {'path': path, 'id': id, 'name': name, 'url': url, 'logo': logo})
    add_directory_item(
        name, url, logo=logo, contextmenu=contextmenu, isfolder=False)
Esempio n. 16
0
def add_show(show):
    log_debug("add_show", 2)
    log_debug("show: %s" % show, 3)

    id = utils.get_value(show, "guide_id")
    name = utils.get_value(show, "title")
    logo = utils.get_value(show, "logo")
    label = utils.get_value(show, "description")
    genre = utils.get_value(show, "genre_name")
    if len(genre) == 0:
        genre = get_genre_name(utils.get_value(show, "genre_id"))

    if not __tunein__.is_show_id(id):
        return

    __showscache__.add(show)

    url = utils.add_params(__settings__.get_argv(0), {"path": "tune-show", "id": id, "name": name, "logo": logo})
    contextmenu = [
        (__settings__.get_string(1009), "XBMC.RunPlugin(%s?path=%s&id=%s)" % (__settings__.get_argv(0), "add", id))
    ]
    add_directory_item(name, url, label=label, genre=genre, logo=logo, contextmenu=contextmenu)
Esempio n. 17
0
def add_custom_url(link, presets=True):
    log_debug("add_custom_url", 2)
    log_debug("link: %s" % link, 3)

    if not __tunein__.is_custom_url_id(utils.get_value(link, "guide_id")):
        return

    id = utils.get_value(link, "guide_id")
    url = utils.get_value(link, "URL")
    name = utils.get_value(link, "text")
    logo = utils.get_value(link, "image")
    path = "custom-url"
    contextmenu = None
    if presets:
        contextmenu = [
            (
                __settings__.get_string(1017),
                "XBMC.RunPlugin(%s?path=%s&id=%s)" % (__settings__.get_argv(0), "remove", id),
            )
        ]
    url = utils.add_params(__settings__.get_argv(0), {"path": path, "id": id, "name": name, "url": url, "logo": logo})
    add_directory_item(name, url, logo=logo, contextmenu=contextmenu, isfolder=False)
Esempio n. 18
0
def add_link_outline(link):
    log_debug("add_link_outline", 2)
    log_debug("link: %s" % link, 3)

    if __tunein__.is_custom_url_id(utils.get_value(link, "guide_id")):
        add_custom_url(link)
        return

    params = utils.get_params(link["URL"].split("?")[1])
    category = utils.get_value(params, "c")
    offset = utils.get_value(params, "offset")
    filter = utils.get_value(params, "filter")
    pivot = utils.get_value(params, "pivot")
    id = utils.get_value(params, "id")
    name = utils.get_value(link, "text")
    logo = ""

    if "image" in link:
        logo = utils.get_value(link, "image")
    label = ""
    if "subtext" in link:
        label = utils.get_value(link, "subtext")

    path = "browse"
    if __tunein__.is_show_id(id):
        path = "tune-show"
        contextmenu = [
            (__settings__.get_string(1009), "XBMC.RunPlugin(%s?path=%s&id=%s)" % (__settings__.get_argv(0), "add", id))
        ]
    else:
        contextmenu = []

    url = utils.add_params(
        __settings__.get_argv(0),
        {"path": path, "id": id, "c": category, "name": name, "filter": filter, "offset": offset, "pivot": pivot},
    )

    add_directory_item(name, url, label=label, logo=logo, contextmenu=contextmenu)
Esempio n. 19
0
def add_show(show):
    log_debug('add_show', 2)
    log_debug('show: %s' % show, 3)

    id = utils.get_value(show, 'guide_id')
    name = utils.get_value(show, 'title')
    logo = utils.get_value(show, 'logo')
    label = utils.get_value(show, 'description')
    genre = utils.get_value(show, 'genre_name')
    if len(genre) == 0:
        genre = get_genre_name(utils.get_value(show, 'genre_id'))

    if not __tunein__.is_show_id(id):
        return

    __showscache__.add(show)

    url = utils.add_params(__settings__.get_argv(
        0), {'path': 'tune-show', 'id': id, 'name': name, 'logo': logo})
    contextmenu = [(__settings__.get_string(1009), 'XBMC.RunPlugin(%s?path=%s&id=%s)' %
                    (__settings__.get_argv(0), 'add', id, ))]
    add_directory_item(name, url, label=label, genre=genre, logo=logo,
                       contextmenu=contextmenu)
Esempio n. 20
0
def add_show_outline(show):
    log_debug('add_show_outline', 2)
    log_debug('show: %s' % show, 3)

    id = utils.get_value(show, 'guide_id')
    name = utils.get_value(show, 'text')
    logo = utils.get_value(show, 'image')
    label = utils.get_value(show, 'subtext')
    album = utils.get_value(show, 'current_track')
    is_preset = utils.get_value(show, 'is_preset')
    preset_number = utils.get_value(show, 'preset_number')

    params = utils.get_params(show['URL'].split('?')[1])
    category = utils.get_value(params, 'c')
    filter = utils.get_value(params, 'filter')

    if not __tunein__.is_show_id(id):
        return

    __showscache__.add(show)

    url = utils.add_params(__settings__.get_argv(0), {
                           'path': 'tune-show', 'id': id, 'name': name, 'logo': logo, 'c': category, 'filter': filter})

    if is_preset == 'true':
        contextmenu = [(
            __settings__.get_string(
                1012), 'XBMC.RunPlugin(%s?path=%s&id=%s&num=%s)' % (__settings__.get_argv(0), 'up', id, preset_number, )),
            (__settings__.get_string(1013), 'XBMC.RunPlugin(%s?path=%s&id=%s&num=%s)' %
             (__settings__.get_argv(0), 'down', id, preset_number,)),
            (__settings__.get_string(1010), 'XBMC.RunPlugin(%s?path=%s&id=%s)' % (__settings__.get_argv(0), 'remove', id, ))]
    else:
        contextmenu = [(__settings__.get_string(
            1009), 'XBMC.RunPlugin(%s?path=%s&id=%s)' % (__settings__.get_argv(0), 'add', id, ))]

    add_directory_item(name, url, label=label, album=album, logo=logo,
                       contextmenu=contextmenu)
Esempio n. 21
0
        utils.ok(__addonname__, __settings__.get_string(3017))

# Display main menu.
else:
    __showscache__.clear()

    # Display main menu.
    contextmenu = [(__settings__.get_string(1011), "XBMC.RunPlugin(%s?path=refresh)" % (__settings__.get_argv(0),))]

    iconImage = __settings__.get_path("%s%s%s" % ("resources/images/", get_logo_colour(), "/favourites-32.png"))
    thumbnailImage = __settings__.get_path("%s%s%s" % ("resources/images/", get_logo_colour(), "/favourites-256.png"))
    liz = xbmcgui.ListItem(__settings__.get_string(1000), iconImage=iconImage, thumbnailImage=thumbnailImage)
    liz.addContextMenuItems(items=contextmenu, replaceItems=True)
    if __settings__.get("fanart") == "true":
        liz.setProperty("fanart_image", __fanart__)
    u = utils.add_params(root=__settings__.get_argv(0), params={"path": "browse", "id": "presets"})
    ok = xbmcplugin.addDirectoryItem(handle=int(__settings__.get_argv(1)), url=u, listitem=liz, isFolder=True)

    if _recentscache.len() > 0:
        iconImage = __settings__.get_path("%s%s%s" % ("resources/images/", get_logo_colour(), "/recents-32.png"))
        thumbnailImage = __settings__.get_path("%s%s%s" % ("resources/images/", get_logo_colour(), "/recents-256.png"))
        liz = xbmcgui.ListItem(__settings__.get_string(1001), iconImage=iconImage, thumbnailImage=thumbnailImage)
        liz.addContextMenuItems(items=contextmenu, replaceItems=True)
        if __settings__.get("fanart") == "true":
            liz.setProperty("fanart_image", __fanart__)
        u = utils.add_params(root=__settings__.get_argv(0), params={"path": "recents"})
        ok = xbmcplugin.addDirectoryItem(handle=int(__settings__.get_argv(1)), url=u, listitem=liz, isFolder=True)

    if __downloadscache__.len() > 0:
        iconImage = __settings__.get_path("%s%s%s" % ("resources/images/", get_logo_colour(), "/downloads-32.png"))
        thumbnailImage = __settings__.get_path(
Esempio n. 22
0
elif __path__ == 'refresh':
	xbmc.executebuiltin('Container.Refresh')

# Display main menu.
else:
	__showscache__.clear()
	
	# Display main menu.
	contextmenu = [(__settings__.get_string(1011), 'XBMC.RunPlugin(%s?path=refresh)' % (__settings__.get_argv(0), ))]
	
	image = __settings__.get_path('%s%s%s' % ('resources/images/', get_logo_colour(), '/presets.png'))
	liz = xbmcgui.ListItem(__settings__.get_string(1000), iconImage=image, thumbnailImage=image)
	liz.addContextMenuItems(items=contextmenu, replaceItems=True)
	if __settings__.get('fanart') == "true":
		liz.setProperty('fanart_image', __fanart__)
	u = utils.add_params(root=__settings__.get_argv(0), params={'path': 'browse', 'id': 'presets'})
	ok = xbmcplugin.addDirectoryItem(handle=int(__settings__.get_argv(1)), url=u, listitem=liz, isFolder=True)

	if __recentscache__.len() > 0:
		image = __settings__.get_path('%s%s%s' % ('resources/images/', get_logo_colour(), '/recents.png'))
		liz = xbmcgui.ListItem(__settings__.get_string(1001), iconImage=image, thumbnailImage=image)
		liz.addContextMenuItems(items=contextmenu, replaceItems=True)
		if __settings__.get('fanart') == "true":
			liz.setProperty('fanart_image', __fanart__)
		u = utils.add_params(root=__settings__.get_argv(0), params={'path': 'recents'})
		ok = xbmcplugin.addDirectoryItem(handle=int(__settings__.get_argv(1)), url=u, listitem=liz, isFolder=True)
	
	if __downloadscache__.len() > 0:
		image = __settings__.get_path('%s%s%s' % ('resources/images/', get_logo_colour(), '/downloads.png'))
		liz = xbmcgui.ListItem(__settings__.get_string(1015), iconImage=image, thumbnailImage=image)
		liz.addContextMenuItems(items=contextmenu, replaceItems=True)
Esempio n. 23
0
                        download = (topic[0], result[1])
                        __downloadscache__.add(download)
                else:
                    utils.ok(__addonname__, __settings__.get_string(
                        3015), __settings__.get_string(3010))

# Refresh display.
elif __path__ == 'refresh':
    xbmc.executebuiltin('Container.Refresh')

# Add station/show to XBMC favourites.
elif __path__ == 'xbmc-favourites':
    log_debug('Adding %s to XBMC favourites' % utils.get_value(__params__, 'name'), 1)
    name = utils.get_value(__params__, 'name')
    logo = utils.get_value(__params__, 'logo')
    command = 'PlayMedia(\"%s\")' % (utils.add_params(root='plugin://%s/' % (__addonid__), params={'logo': logo, 'path': 'tune', 'id': utils.get_value(__params__, 'id'), 'name': name}))
    if not utils.add_to_favourites(name, logo, command):
        utils.ok(__addonname__, __settings__.get_string(3017))

# Display main menu.
else:
    __showscache__.clear()

    if __onlyfavourites__:
        # Display users presets.
        if __username__ is None or len(__username__) == 0:
            utils.ok(__addonname__, __settings__.get_string(
                3001), __settings__.get_string(3002))
        else:
            results = __tunein__.browse_presets(username=__username__)
            process_tunein_json(results)