- Riorganizzazione Impostazioni

- Nascondi Server per Autoplay
 . Episodio Successivo con Finestra PopUp
This commit is contained in:
Alhaziel
2020-01-09 12:32:12 +01:00
parent b107d5dadf
commit 064a8a7fa9
6 changed files with 55 additions and 23 deletions

View File

@@ -981,7 +981,7 @@ def controls(itemlist, item, AutoPlay=True, CheckLinks=True, down_load=True):
channel_node = autoplay_node.get(item.channel, {})
settings_node = channel_node.get('settings', {})
AP = get_setting('autoplay') or settings_node['active']
HS = config.get_setting('next_ep')
HS = config.get_setting('hide_servers')
if CL and not AP:
if get_setting('checklinks', item.channel):
@@ -1010,7 +1010,7 @@ def controls(itemlist, item, AutoPlay=True, CheckLinks=True, down_load=True):
VL = True
except:
pass
if not AP or VL or HS == 0:
if not AP or VL or not HS:
return itemlist
def filterLang(item, itemlist):

View File

@@ -479,7 +479,6 @@ def play_from_library(item):
itemlist = videolibrary.findvideos(item)
while platformtools.is_playing():
# Ventana convencional
sleep(5)
@@ -522,15 +521,20 @@ def play_from_library(item):
else:
cabecera = config.get_localized_string(30163)
seleccion = platformtools.dialog_select(cabecera, opciones)
if (not config.get_setting('autoplay') and not config.get_setting('hide_servers')) or item.no_window:
seleccion = platformtools.dialog_select(cabecera, opciones)
if seleccion == -1:
return
else:
item = videolibrary.play(itemlist[seleccion])[0]
item.play_from = 'window'
platformtools.play_video(item)
if seleccion == -1:
return
else:
item = videolibrary.play(itemlist[seleccion])[0]
item.play_from = 'window'
platformtools.play_video(item)
from specials import autoplay
if (platformtools.is_playing() and item.action) or item.server == 'torrent' or autoplay.is_active(item.contentChannel):
break
if config.get_setting('next_ep') > 0 and item.contentType != 'movie':
from specials.nextep import afther_stop
afther_stop(item)

View File

@@ -5729,6 +5729,10 @@ msgctxt "#70752"
msgid "Do nothing"
msgstr ""
msgctxt "#70753"
msgid "Playback"
msgstr ""
# DNS start [ settings and declaration ]
msgctxt "#707401"
msgid "Enable DNS Check Alert"

View File

@@ -5733,6 +5733,10 @@ msgctxt "#70752"
msgid "Do nothing"
msgstr "Non fare nulla"
msgctxt "#70753"
msgid "Playback"
msgstr "Riproduzione"
# DNS start [ settings and declaration ]
msgctxt "#707401"
msgid "Enable DNS Check Alert"

View File

@@ -2,13 +2,7 @@
<settings>
<!-- General -->
<category label="70168">
<setting id="player_mode" type="enum" values="Direct|SetResolvedUrl|Built-In|Download and Play" label="30044" default="1"/>
<setting id="default_action" type="enum" lvalues="30006|30007|30008" label="30005" default="0"/>
<setting id="autoplay" type="bool" label="70562" default="false" visible="true"/>
<setting id="next_ep" type="enum" label="70746" lvalues="70752|70747|70748" default="0"/>
<setting id="next_ep_seconds" type="enum" values="20|30|40|50|60" label="secondi prima della finestra" default="3" visible="eq(-1,2)"/>
<setting id="checklinks" type="bool" label="30020" default="false"/>
<setting id="checklinks_number" type="enum" values="5|10|15|20" label="30021" default="0" visible="eq(-1,true)"/>
<setting id="thumbnail_type" type="enum" lvalues="30011|30012|30200" label="30010" default="2"/>
<setting id="channel_language" type="labelenum" values="auto|all|ita" label="30019" default="all"/>
<setting id="trakt_sync" type="bool" label="70109" default="false"/>
@@ -41,6 +35,16 @@
<setting id="enable_library_menu" label="30131" type="bool" default="true"/>
</category>
<!-- Playback -->
<category label="70753">
<setting id="player_mode" type="enum" values="Direct|SetResolvedUrl|Built-In|Download and Play" label="30044" default="1"/>
<setting id="default_action" type="enum" lvalues="30006|30007|30008" label="30005" default="0"/>
<setting id="autoplay" type="bool" label="70562" default="false" visible="true"/>
<setting id="hide_servers" type="bool" label="70747" default="false" visible="eq(-1,true)"/>
<setting id="checklinks" type="bool" label="30020" default="false"/>
<setting id="checklinks_number" type="enum" values="5|10|15|20" label="30021" default="0" visible="eq(-1,true)"/>
</category>
<!-- Videolibrary -->
<category label="30131">
<!-- <setting id="downloadpath" type="folder" label="30017" default=""/>
@@ -54,6 +58,8 @@
<setting id="videolibrary_kodi_force" type="bool" label="" default="false" visible="false"/>
<setting id="videolibrary_kodi" type="bool" label="70120" enable="lt(-1,2)+eq(0,false)" default="false"/>
<setting id="videolibrary_max_quality" type="bool" label="70729" default="false" visible="true"/>
<setting id="next_ep" type="enum" label="70746" lvalues="70752|70747|70748" default="0"/>
<setting id="next_ep_seconds" type="enum" values="20|30|40|50|60" label="secondi prima della finestra" default="3" visible="eq(-1,2)"/>
</category>

View File

@@ -5,10 +5,14 @@ from time import time, sleep
from core import scrapertools
from core import jsontools, filetools
normal_window = True if config.get_setting("window_type", "videolibrary") == 0 else False
def afther_stop(item):
logger.info()
condition = config.get_setting('next_ep')
# from core.support import dbg; dbg()
if condition == 1: # Hide servers afther stop video
while not platformtools.is_playing():
@@ -22,11 +26,15 @@ def afther_stop(item):
from platformcode.launcher import play_from_library
# Check if next episode exist
current_filename = os.path.basename(item.strm_path)
path = filetools.join(config.get_videolibrary_path(), config.get_setting("folder_tvshows"),os.path.dirname(item.strm_path))
base_path = os.path.basename(os.path.normpath(os.path.dirname(item.strm_path)))
logger.info('PATH:' + base_path)
path = filetools.join(config.get_videolibrary_path(), config.get_setting("folder_tvshows"),base_path)
logger.info('PATH:' + path)
fileList = []
for file in os.listdir(path):
if file.endswith('.strm'):
fileList.append(file)
# from core.support import dbg; dbg()
nextIndex = fileList.index(current_filename) + 1
if nextIndex == 0 or nextIndex == len(fileList):
next_file = None
@@ -64,7 +72,7 @@ def afther_stop(item):
item.contentSeason = item.infoLabels['season'] = season
item.contentEpisodeNumber = item.infoLabels['episode'] = episode
item.contentTitle = item.infoLabels['title'] = next_ep
item.strm_path = filetools.join(os.path.dirname(item.strm_path), next_file)
item.strm_path = filetools.join(base_path, next_file)
# from core.support import dbg; dbg()
global ITEM
@@ -80,13 +88,19 @@ def afther_stop(item):
if nextDialog.stillwatching or nextDialog.continuewatching:
xbmc.Player().stop()
sleep(0.5)
xbmc.executebuiltin('Action(Back)')
if normal_window:
sleep(0.5)
xbmc.executebuiltin('Action(Back)')
else:
item.no_window = True
sleep(0.5)
play_from_library(item)
else:
sleep(0.5)
xbmc.executebuiltin('Action(Back)')
if normal_window:
sleep(0.5)
xbmc.executebuiltin('Action(Back)')
else:
item.no_window = True
import xbmcgui