Selezione Tipologia Visualizzazione Riprendi da (Impostazioni/Riproduzione)

This commit is contained in:
Alhaziel01
2023-06-23 19:44:35 +02:00
parent 7431f78b58
commit b2288673dc
4 changed files with 79 additions and 8 deletions

View File

@@ -1618,8 +1618,52 @@ def play_torrent(item, xlistitem, mediaurl):
xbmc.sleep(3000)
xbmc.executebuiltin("PlayMedia(" + torrent_options[selection][1] % mediaurl + ")")
def resume_playback(played_time):
class ResumePlayback(xbmcgui.WindowXMLDialog):
Close = False
Resume = False
def __init__(self, *args, **kwargs):
self.action_exitkeys_id = [92, 10]
self.progress_control = None
played_time = kwargs.get('played_time')
m, s = divmod(played_time, 60)
h, m = divmod(m, 60)
self.setProperty("time", '%02d:%02d:%02d' % (h, m, s))
def set_values(self, value):
self.Resume = value
self.Close = True
def is_close(self):
return self.Close
def onClick(self, controlId):
if controlId == 3012: # Resume
self.set_values(True)
self.close()
elif controlId == 3013: # Cancel
self.set_values(False)
self.close()
def onAction(self, action):
if action in self.action_exitkeys_id:
self.set_values(False)
self.close()
if played_time and played_time > 30:
if config.get_setting('resume_menu') == 0:
Dialog = ResumePlayback('ResumePlayback.xml', config.get_runtime_path(), played_time=played_time)
Dialog.show()
t = 0
while not Dialog.is_close() and t < 100:
t += 1
xbmc.sleep(100)
if not Dialog.Resume: played_time = 0
else:
m, s = divmod(played_time, 60)
h, m = divmod(m, 60)
idx = xbmcgui.Dialog().contextmenu(
@@ -1627,8 +1671,10 @@ def resume_playback(played_time):
xbmc.getLocalizedString(12022).format('%02d:%02d:%02d' % (h, m, s)),
xbmc.getLocalizedString(12021)
])
if idx: played_time = 0
if idx in [-1, 0]: played_time = 0
else: played_time = 0
xbmc.sleep(300)
return played_time
##### INPUTSTREM #####

View File

@@ -199,6 +199,18 @@ msgctxt "#30046"
msgid "Resume from start"
msgstr ""
msgctxt "#30047"
msgid "Show resume from How:"
msgstr "Mostra riprendi da come:"
msgctxt "#30048"
msgid "Custom window"
msgstr "Finestra personalizzata"
msgctxt "#30049"
msgid "Skin window"
msgstr "Finestra della skin"
msgctxt "#30050"
msgid "Server connection error"
msgstr ""

View File

@@ -199,6 +199,18 @@ msgctxt "#30046"
msgid "Resume from start"
msgstr "Riprendi dall'inizio"
msgctxt "#30047"
msgid "Show resume from How:"
msgstr "Mostra riprendi da come:"
msgctxt "#30048"
msgid "Custom window"
msgstr "Finestra personalizzata"
msgctxt "#30049"
msgid "Skin window"
msgstr "Finestra della skin"
msgctxt "#30050"
msgid "Server connection error"
msgstr "Errore connessione server"

View File

@@ -24,6 +24,7 @@
<setting id="servers_favorites" visible="true" type="action" label="60551" action="RunPlugin(plugin://plugin.video.kod/?ew0KICAgICJhY3Rpb24iOiAic2VydmVyc19mYXZvcml0ZXMiLA0KICAgICJjaGFubmVsIjogInNldHRpbmciDQp9==)"/>
<setting id="servers_blacklist" visible="true" type="action" label="60550" action="RunPlugin(plugin://plugin.video.kod/?ew0KICAgICJhY3Rpb24iOiAic2VydmVyc19ibGFja2xpc3QiLA0KICAgICJjaGFubmVsIjogInNldHRpbmciDQp9==)"/>
<setting id="window_type" type="select" lvalues="60622|60623" label="60621" default="0"/>
<setting id="resume_menu" type="select" lvalues="30048|30049" label="30047" default="0"/>
<!-- <setting id="hide_servers" type="bool" label="70747" default="false" visible="eq(-1,true)" subsetting="true"/> -->
<setting id="checklinks" type="bool" label="30020" default="false"/>
<setting id="checklinks_number" type="slider" option="int" range="5,5,20" label="30021" default="5" visible="eq(-1,true)" subsetting="true"/>