Add live tv support

This commit is contained in:
angelblue05 2018-09-23 03:03:31 -05:00
parent d54aad726e
commit c03cddef76
3 changed files with 16 additions and 2 deletions

View file

@ -183,6 +183,13 @@ def get_items_by_letter(parent_id=None, media=None, letter=None):
'IncludeItemTypes': media
})
def get_channels():
return _get("LiveTv/Channels", {
'UserId': "{UserId}",
'EnableImages': True,
'EnableUserData': True
})
def get_intros(item_id):
return user_items("/%s/Intros" % item_id)

View file

@ -256,6 +256,8 @@ def browse(media, view_id=None, folder=None, server_id=None):
listing = TheVoid('RecentlyAdded', {'Id': view_id, 'ServerId': server_id}).get()
elif folder == 'genres':
listing = TheVoid('Genres', {'Id': view_id, 'ServerId': server_id}).get()
elif media == 'livetv':
listing = TheVoid('LiveTV', {'Id': view_id, 'ServerId': server_id}).get()
elif folder == 'unwatched':
listing = TheVoid('Browse', {'Id': view_id, 'ServerId': server_id, 'Filters': ['IsUnplayed']}).get()
elif folder == 'favorite':

View file

@ -56,7 +56,7 @@ class Monitor(xbmc.Monitor):
'PlayPlaylist', 'Play', 'GetIntros', 'GetAdditionalParts', 'RefreshItem', 'Genres',
'FavoriteItem', 'DeleteItem', 'AddUser', 'GetSession', 'GetUsers', 'GetThemes',
'GetTheme', 'Playstate', 'GeneralCommand', 'GetTranscodeOptions', 'RecentlyAdded',
'BrowseSeason'):
'BrowseSeason', 'LiveTV', 'GetLiveStream'):
return
data = json.loads(data)[0]
@ -119,7 +119,7 @@ class Monitor(xbmc.Monitor):
elif method == 'GetLiveStream':
sources = server['api'].get_play_info(data['Id'], data['PlaySessionId'], data['Token'], data['Profile'])
sources = server['api'].get_live_stream(data['Id'], data['PlaySessionId'], data['Token'], data['Profile'])
self.void_responder(data, sources)
elif method == 'GetToken':
@ -168,6 +168,11 @@ class Monitor(xbmc.Monitor):
result = server['api'].get_seasons(data['Id'])
self.void_responder(data, result)
elif method == 'LiveTV':
result = server['api'].get_channels()
self.void_responder(data, result)
elif method == 'RecentlyAdded':
result = server['api'].get_recently_added(data.get('Media'), data.get('Id'), data.get('Limit'))