Merge remote-tracking branch 'origin/master'
This commit is contained in:
@@ -14,6 +14,7 @@ from core import scrapertools
|
|||||||
from core import servertools
|
from core import servertools
|
||||||
from core import trakt_tools
|
from core import trakt_tools
|
||||||
from core import videolibrarytools
|
from core import videolibrarytools
|
||||||
|
from core import filetools
|
||||||
from core.item import Item
|
from core.item import Item
|
||||||
from platformcode import config, logger
|
from platformcode import config, logger
|
||||||
from platformcode import platformtools
|
from platformcode import platformtools
|
||||||
@@ -441,19 +442,18 @@ def play_from_library(item):
|
|||||||
@param item: elemento con información
|
@param item: elemento con información
|
||||||
"""
|
"""
|
||||||
logger.info()
|
logger.info()
|
||||||
#logger.debug("item: \n" + item.tostring('\n'))
|
logger.debug("item: \n" + item.tostring('\n'))
|
||||||
|
|
||||||
import xbmcgui
|
import xbmcgui
|
||||||
import xbmcplugin
|
import xbmcplugin
|
||||||
import xbmc
|
import xbmc
|
||||||
from time import sleep
|
from time import sleep, time
|
||||||
|
|
||||||
from core import jsontools
|
from core import jsontools
|
||||||
autoplay_node = jsontools.get_node_from_file('autoplay', 'AUTOPLAY')
|
path = filetools.join(config.get_videolibrary_path(), config.get_setting("folder_tvshows"))
|
||||||
channel_node = autoplay_node.get(item.channel, {})
|
AP = config.get_setting('autoplay')
|
||||||
settings_node = channel_node.get('settings', {})
|
|
||||||
AP = config.get_setting('autoplay') or settings_node['active']
|
|
||||||
APS = config.get_setting('autoplay_server_list')
|
APS = config.get_setting('autoplay_server_list')
|
||||||
|
NE = config.get_setting('autoplay_next')
|
||||||
|
|
||||||
# Intentamos reproducir una imagen (esto no hace nada y ademas no da error)
|
# Intentamos reproducir una imagen (esto no hace nada y ademas no da error)
|
||||||
xbmcplugin.setResolvedUrl(int(sys.argv[1]), True,
|
xbmcplugin.setResolvedUrl(int(sys.argv[1]), True,
|
||||||
@@ -468,17 +468,49 @@ def play_from_library(item):
|
|||||||
item.action = "findvideos"
|
item.action = "findvideos"
|
||||||
|
|
||||||
window_type = config.get_setting("window_type", "videolibrary")
|
window_type = config.get_setting("window_type", "videolibrary")
|
||||||
|
episodes = scrapertools.find_single_match(item.strm_path, '(\d+)x(\d+)')
|
||||||
|
season = int(episodes[0])
|
||||||
|
episode = int(episodes[1])
|
||||||
|
|
||||||
|
|
||||||
# y volvemos a lanzar kodi
|
# y volvemos a lanzar kodi
|
||||||
if xbmc.getCondVisibility('Window.IsMedia') and not window_type == 1:
|
if xbmc.getCondVisibility('Window.IsMedia') and not window_type == 1:
|
||||||
# Ventana convencional
|
# Ventana convencional
|
||||||
xbmc.executebuiltin("Container.Update(" + sys.argv[0] + "?" + item.tourl() + ")")
|
xbmc.executebuiltin("Container.Update(" + sys.argv[0] + "?" + item.tourl() + ")")
|
||||||
if AP and APS:
|
if AP and NE:
|
||||||
while not platformtools.is_playing():
|
while not platformtools.is_playing():
|
||||||
pass
|
pass
|
||||||
while platformtools.is_playing():
|
while platformtools.is_playing():
|
||||||
pass
|
pass
|
||||||
sleep(0.1)
|
sleep(0.5)
|
||||||
|
xbmc.executebuiltin('Action(Back)')
|
||||||
|
ep = '%dx%02d' % (season, episode)
|
||||||
|
next_ep = '%dx%02d' % (season, episode+1)
|
||||||
|
next_season = '%dx%02d' % (season+1, 1)
|
||||||
|
next_ep_path = item.strm_path.replace(ep,next_ep)
|
||||||
|
next_season_path = item.strm_path.replace(ep,next_ep)
|
||||||
|
play_next = False
|
||||||
|
if os.path.isfile(path+next_ep_path):
|
||||||
|
item.contentEpisodeNumber = item.infoLabels['episode'] = episode+1
|
||||||
|
item.contentTitle = item.infoLabels['title'] = next_ep
|
||||||
|
item.strm_path = next_ep_path
|
||||||
|
play_next = True
|
||||||
|
elif os.path.isfile(path+next_season_path):
|
||||||
|
item.contentSeason = item.infoLabels['season'] = season+1
|
||||||
|
item.contentEpisodeNumber = item.infoLabels['episode'] = 1
|
||||||
|
item.contentTitle = item.infoLabels['title'] = next_season
|
||||||
|
item.strm_path = next_season_path
|
||||||
|
play = True
|
||||||
|
|
||||||
|
if play_next == True and platformtools.dialog_yesno('Prossimo Episodio?', item.contentTitle, nolabel="Sì", yeslabel="No", autoclose=5000) == 0:
|
||||||
|
play_from_library(item)
|
||||||
|
|
||||||
|
elif AP and APS:
|
||||||
|
while not platformtools.is_playing():
|
||||||
|
pass
|
||||||
|
while platformtools.is_playing():
|
||||||
|
pass
|
||||||
|
sleep(0.5)
|
||||||
xbmc.executebuiltin('Action(Back)')
|
xbmc.executebuiltin('Action(Back)')
|
||||||
|
|
||||||
else:
|
else:
|
||||||
|
|||||||
@@ -5,6 +5,7 @@
|
|||||||
<setting id="player_mode" type="enum" values="Direct|SetResolvedUrl|Built-In|Download and Play" label="30044" default="1"/>
|
<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="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="autoplay" type="bool" label="70562" default="false" visible="true"/>
|
||||||
|
<setting id="autoplay_next" type="bool" label="Riproduci episodio successivo" default="false" visible="true"/>
|
||||||
<setting id="autoplay_server_list" type="bool" label="70746" default="false" visible="true"/>
|
<setting id="autoplay_server_list" type="bool" label="70746" default="false" visible="true"/>
|
||||||
<setting id="checklinks" type="bool" label="30020" default="false"/>
|
<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="checklinks_number" type="enum" values="5|10|15|20" label="30021" default="0" visible="eq(-1,true)"/>
|
||||||
|
|||||||
Reference in New Issue
Block a user