def play(item): logger.info("tvalacarta.channels.api_programas play item=" + item.tostring()) api.mark_as_watched(item, really_watched=True) exec "from channels import " + item.channel_id + " as channelmodule" if hasattr(channelmodule, 'play'): play_items = channelmodule.play(item) else: item.server = item.channel_id play_items = [item] valid_url = False for play_item in play_items: if play_item.server == "directo" and play_item.url.startswith("http"): valid_url = True if play_item.server <> "directo": valid_url = True if not valid_url: response = api.videos_get_media_url(item) play_items = [ Item(channel=item.channel, server="directo", url=response["body"]) ] return play_items
def play(item): logger.info("tvalacarta.channels.api_programas play item="+item.tostring()) api.mark_as_watched(item,really_watched=True) exec "from channels import "+item.channel_id+" as channelmodule" if hasattr(channelmodule, 'play'): play_items = channelmodule.play(item) else: item.server = item.channel_id play_items = [item] valid_url = False for play_item in play_items: if play_item.server=="directo" and play_item.url.startswith("http"): valid_url = True if play_item.server<>"directo": valid_url = True if not valid_url: response = api.videos_get_media_url(item) play_items = [Item(channel=item.channel, server="directo", url=response["body"])] return play_items
def mark_as_watched(item): logger.info("tvalacarta.channels.api_programas mark_as_watched item="+repr(item)) api.mark_as_watched(item,really_watched=False) if config.is_xbmc(): import xbmc xbmc.executebuiltin("XBMC.Container.Refresh()");
def mark_as_watched(item): logger.info("tvalacarta.channels.api_programas mark_as_watched item=" + repr(item)) api.mark_as_watched(item, really_watched=False) if config.is_xbmc(): import xbmc xbmc.executebuiltin("XBMC.Container.Refresh()")