This commit is contained in:
croneter 2018-01-23 19:13:47 +01:00
parent 4b0fa90f5e
commit e8d9252891

View file

@ -2,7 +2,7 @@
############################################################################### ###############################################################################
from logging import getLogger from logging import getLogger
from downloadutils import DownloadUtils from downloadutils import DownloadUtils as DU
from utils import window, settings, language as lang, dialog, tryEncode from utils import window, settings, language as lang, dialog, tryEncode
import variables as v import variables as v
@ -15,9 +15,12 @@ LOG = getLogger("PLEX." + __name__)
class PlayUtils(): class PlayUtils():
def __init__(self, api, playqueue_item): def __init__(self, api, playqueue_item):
"""
init with api (PlexAPI wrapper of the PMS xml element) and
playqueue_item (Playlist_Item())
"""
self.api = api self.api = api
self.item = playqueue_item self.item = playqueue_item
self.doUtils = DownloadUtils().downloadUrl
def getPlayUrl(self): def getPlayUrl(self):
""" """
@ -322,7 +325,7 @@ class PlayUtils():
'audioStreamID': audio_streams_list[resp], 'audioStreamID': audio_streams_list[resp],
'allParts': 1 'allParts': 1
} }
self.doUtils('{server}/library/parts/%s' % part_id, DU().downloadUrl('{server}/library/parts/%s' % part_id,
action_type='PUT', action_type='PUT',
parameters=args) parameters=args)
@ -355,6 +358,6 @@ class PlayUtils():
'subtitleStreamID': select_subs_index, 'subtitleStreamID': select_subs_index,
'allParts': 1 'allParts': 1
} }
self.doUtils('{server}/library/parts/%s' % part_id, DU().downloadUrl('{server}/library/parts/%s' % part_id,
action_type='PUT', action_type='PUT',
parameters=args) parameters=args)