mirror of
https://github.com/jellyfin/jellyfin-kodi.git
synced 2025-06-03 14:56:13 +00:00
Launch playback via default.py
I've commented out the resume dialog. If we actually need it then it can be readded.
This commit is contained in:
parent
210b0831c7
commit
8e3a22e0e8
3 changed files with 75 additions and 35 deletions
24
default.py
24
default.py
|
@ -12,24 +12,26 @@ cwd = addonSettings.getAddonInfo('path')
|
|||
BASE_RESOURCE_PATH = xbmc.translatePath( os.path.join( cwd, 'resources', 'lib' ) )
|
||||
sys.path.append(BASE_RESOURCE_PATH)
|
||||
|
||||
WINDOW = xbmcgui.Window( 10000 )
|
||||
WINDOW = xbmcgui.Window(10000)
|
||||
|
||||
import Utils as utils
|
||||
from PlaybackUtils import PlaybackUtils
|
||||
from DownloadUtils import DownloadUtils
|
||||
|
||||
try:
|
||||
params=utils.get_params(sys.argv[2])
|
||||
mode = params.get('mode',"")
|
||||
id = params.get('id',"")
|
||||
params = utils.get_params(sys.argv[2])
|
||||
mode = params['mode']
|
||||
id = params['id']
|
||||
except:
|
||||
params={}
|
||||
mode=None
|
||||
id=None
|
||||
params = {}
|
||||
mode = None
|
||||
|
||||
if mode == "play":
|
||||
# Play items via plugin://plugin.video.emby/
|
||||
url = "{server}/mediabrowser/Users/{UserId}/Items/%s?format=json&ImageTypeLimit=1" % id
|
||||
result = DownloadUtils().downloadUrl(url)
|
||||
item = PlaybackUtils().PLAY(result, setup="default")
|
||||
|
||||
if mode != None and mode == "play":
|
||||
listItem = xbmcgui.ListItem(path="")
|
||||
xbmcplugin.setResolvedUrl (int(sys.argv[1]), True, listItem)
|
||||
WINDOW.setProperty('GUIPLAY', str(id)) # set window prop
|
||||
elif sys.argv[1] == "reset":
|
||||
utils.reset()
|
||||
else:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue