mirror of
https://github.com/jellyfin/jellyfin-kodi.git
synced 2024-11-10 12:16:12 +00:00
Add live tv support
This commit is contained in:
parent
d54aad726e
commit
c03cddef76
3 changed files with 16 additions and 2 deletions
|
@ -183,6 +183,13 @@ def get_items_by_letter(parent_id=None, media=None, letter=None):
|
||||||
'IncludeItemTypes': media
|
'IncludeItemTypes': media
|
||||||
})
|
})
|
||||||
|
|
||||||
|
def get_channels():
|
||||||
|
return _get("LiveTv/Channels", {
|
||||||
|
'UserId': "{UserId}",
|
||||||
|
'EnableImages': True,
|
||||||
|
'EnableUserData': True
|
||||||
|
})
|
||||||
|
|
||||||
def get_intros(item_id):
|
def get_intros(item_id):
|
||||||
return user_items("/%s/Intros" % item_id)
|
return user_items("/%s/Intros" % item_id)
|
||||||
|
|
||||||
|
|
|
@ -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()
|
listing = TheVoid('RecentlyAdded', {'Id': view_id, 'ServerId': server_id}).get()
|
||||||
elif folder == 'genres':
|
elif folder == 'genres':
|
||||||
listing = TheVoid('Genres', {'Id': view_id, 'ServerId': server_id}).get()
|
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':
|
elif folder == 'unwatched':
|
||||||
listing = TheVoid('Browse', {'Id': view_id, 'ServerId': server_id, 'Filters': ['IsUnplayed']}).get()
|
listing = TheVoid('Browse', {'Id': view_id, 'ServerId': server_id, 'Filters': ['IsUnplayed']}).get()
|
||||||
elif folder == 'favorite':
|
elif folder == 'favorite':
|
||||||
|
|
|
@ -56,7 +56,7 @@ class Monitor(xbmc.Monitor):
|
||||||
'PlayPlaylist', 'Play', 'GetIntros', 'GetAdditionalParts', 'RefreshItem', 'Genres',
|
'PlayPlaylist', 'Play', 'GetIntros', 'GetAdditionalParts', 'RefreshItem', 'Genres',
|
||||||
'FavoriteItem', 'DeleteItem', 'AddUser', 'GetSession', 'GetUsers', 'GetThemes',
|
'FavoriteItem', 'DeleteItem', 'AddUser', 'GetSession', 'GetUsers', 'GetThemes',
|
||||||
'GetTheme', 'Playstate', 'GeneralCommand', 'GetTranscodeOptions', 'RecentlyAdded',
|
'GetTheme', 'Playstate', 'GeneralCommand', 'GetTranscodeOptions', 'RecentlyAdded',
|
||||||
'BrowseSeason'):
|
'BrowseSeason', 'LiveTV', 'GetLiveStream'):
|
||||||
return
|
return
|
||||||
|
|
||||||
data = json.loads(data)[0]
|
data = json.loads(data)[0]
|
||||||
|
@ -119,7 +119,7 @@ class Monitor(xbmc.Monitor):
|
||||||
|
|
||||||
elif method == 'GetLiveStream':
|
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)
|
self.void_responder(data, sources)
|
||||||
|
|
||||||
elif method == 'GetToken':
|
elif method == 'GetToken':
|
||||||
|
@ -168,6 +168,11 @@ class Monitor(xbmc.Monitor):
|
||||||
result = server['api'].get_seasons(data['Id'])
|
result = server['api'].get_seasons(data['Id'])
|
||||||
self.void_responder(data, result)
|
self.void_responder(data, result)
|
||||||
|
|
||||||
|
elif method == 'LiveTV':
|
||||||
|
|
||||||
|
result = server['api'].get_channels()
|
||||||
|
self.void_responder(data, result)
|
||||||
|
|
||||||
elif method == 'RecentlyAdded':
|
elif method == 'RecentlyAdded':
|
||||||
|
|
||||||
result = server['api'].get_recently_added(data.get('Media'), data.get('Id'), data.get('Limit'))
|
result = server['api'].get_recently_added(data.get('Media'), data.get('Id'), data.get('Limit'))
|
||||||
|
|
Loading…
Reference in a new issue