Add force transcode settings

This commit is contained in:
angelblue05 2018-10-06 18:44:15 -05:00
parent 14c07ce42f
commit 4ecd3fa2f6
3 changed files with 12 additions and 6 deletions

View file

@ -881,3 +881,7 @@ msgstr ""
msgctxt "#33178" msgctxt "#33178"
msgid "Processing updates" msgid "Processing updates"
msgstr "" msgstr ""
msgctxt "#33179"
msgid "Force transcode"
msgstr ""

View file

@ -52,13 +52,14 @@ class Actions(object):
listitem = xbmcgui.ListItem() listitem = xbmcgui.ListItem()
LOG.info("[ play/%s ] %s", item['Id'], item['Name']) LOG.info("[ play/%s ] %s", item['Id'], item['Name'])
playlist = self.get_playlist(item) transcode = transcode or settings('playFromTranscode.bool')
kodi_playlist = self.get_playlist(item)
play = playutils.PlayUtils(item, transcode, self.server_id, self.server) play = playutils.PlayUtils(item, transcode, self.server_id, self.server)
source = play.select_source(play.get_sources()) source = play.select_source(play.get_sources())
play.set_external_subs(source, listitem) play.set_external_subs(source, listitem)
self.set_playlist(item, listitem, db_id, transcode) self.set_playlist(item, listitem, db_id, transcode)
index = max(playlist.getposition(), 0) + 1 # Can return -1 index = max(kodi_playlist.getposition(), 0) + 1 # Can return -1
force_play = False force_play = False
self.stack[0][1].setPath(self.stack[0][0]) self.stack[0][1].setPath(self.stack[0][0])
@ -75,12 +76,12 @@ class Actions(object):
for stack in self.stack: for stack in self.stack:
playlist.add(url=stack[0], listitem=stack[1], index=index) kodi_playlist.add(url=stack[0], listitem=stack[1], index=index)
index += 1 index += 1
if force_play: if force_play:
if len(sys.argv) > 1: xbmcplugin.setResolvedUrl(int(sys.argv[1]), False, self.stack[0][1]) if len(sys.argv) > 1: xbmcplugin.setResolvedUrl(int(sys.argv[1]), False, self.stack[0][1])
xbmc.Player().play(playlist, windowed=False) xbmc.Player().play(kodi_playlist, windowed=False)
def set_playlist(self, item, listitem, db_id=None, transcode=False): def set_playlist(self, item, listitem, db_id=None, transcode=False):

View file

@ -41,8 +41,9 @@
<setting label="30518" id="enableCinema" type="bool" default="true" /> <setting label="30518" id="enableCinema" type="bool" default="true" />
<setting label="30519" id="askCinema" type="bool" default="false" visible="eq(-1,true)" subsetting="true" /> <setting label="30519" id="askCinema" type="bool" default="false" visible="eq(-1,true)" subsetting="true" />
<setting label="30002" id="playFromStream" type="bool" default="true" /> <setting label="30002" id="playFromStream" type="bool" default="true" />
<setting label="30522" id="transcode_h265" type="bool" default="false" /> <setting label="33179" id="playFromTranscode" type="bool" default="false" visible="eq(-1,true)" subsetting="true" />
<setting label="30537" id="transcodeHi10P" type="bool" default="false"/> <setting label="30522" id="transcode_h265" type="bool" default="false" visible="eq(-1,false)" />
<setting label="30537" id="transcodeHi10P" type="bool" default="false" visible="eq(-2,false)" />
<setting label="33114" id="enableExternalSubs" type="bool" default="true" /> <setting label="33114" id="enableExternalSubs" type="bool" default="true" />
<setting label="33159" id="skipDialogTranscode" type="enum" lvalues="305|33157|33158|13106" visible="true" default="3" /> <setting label="33159" id="skipDialogTranscode" type="enum" lvalues="305|33157|33158|13106" visible="true" default="3" />
<setting label="33115" type="lsep" /> <setting label="33115" type="lsep" />