- Unico Tread per:

- Segna come visto
  - Episodio successivo
- Rimosse impostazioni nascondi server (non più necessarie)
- Ottimizzazione grafica finestre
This commit is contained in:
Alhaziel01
2020-06-18 17:13:44 +02:00
parent 3770274912
commit d0c3294314
43 changed files with 557 additions and 701 deletions

View File

@@ -267,4 +267,4 @@ def findvid_serie(item):
def play(item):
support.log()
return servertools.find_video_items(data=item.url)
return servertools.find_video_items(item, data=item.url)

View File

@@ -1192,9 +1192,6 @@ def server(item, data='', itemlist=[], headers='', AutoPlay=True, CheckLinks=Tru
if patronTag:
addQualityTag(item, verifiedItemlist, data, patronTag)
# Auto Play & Hide Links
AP = config.get_setting('autoplay')
# Check Links
if not item.global_search and (config.get_setting('checklinks') or config.get_setting('checklinks', item.channel)):
if config.get_setting('checklinks', item.channel):
@@ -1210,8 +1207,8 @@ def server(item, data='', itemlist=[], headers='', AutoPlay=True, CheckLinks=Tru
videolibrary(verifiedItemlist, item)
if Download:
download(verifiedItemlist, item, function_level=3)
if item.contentChannel == 'videolibrary' or not config.get_setting('autoplay') or not config.get_setting('hide_servers'):
return verifiedItemlist
# if item.contentChannel == 'videolibrary' or not config.get_setting('autoplay'):
return verifiedItemlist
def filterLang(item, itemlist):

View File

@@ -400,7 +400,6 @@ def limit_itemlist(itemlist):
def play_from_library(item):
# from core.support import dbg;dbg()
"""
The .strm files when played from kodi, this expects it to be a "playable" file so it cannot contain
more items, at most a selection dialog can be placed.
@@ -413,96 +412,65 @@ def play_from_library(item):
"""
import xbmcgui, xbmcplugin, xbmc
from time import sleep, time
from specials import nextep
def show_server(item, itemlist, p_dialog):
if item.show_server:
# The number of links to show is limited
if config.get_setting("max_links", "videolibrary") != 0: itemlist = limit_itemlist(itemlist)
# The list of links is slightly "cleaned"
if config.get_setting("replace_VD", "videolibrary") == 1: itemlist = reorder_itemlist(itemlist)
p_dialog.update(100, ''); sleep(0.5); p_dialog.close()
if len(itemlist) > 0:
while not xbmc.Monitor().abortRequested():
# The user chooses the mirror
options = []
selection_implementation =0
for item in itemlist:
item.thumbnail = "https://github.com/kodiondemand/media/raw/master/resources/servers/" + item.server.lower() + '.png'
quality = '[B][' + item.quality + '][/B]' if item.quality else ''
if item.server:
it = xbmcgui.ListItem('\n[B]%s[/B] %s - %s' % (item.server, quality, item.contentTitle))
it.setArt({'thumb':item.thumbnail})
options.append(it)
else:
selection_implementation += 1
# The selection window opens
if (item.contentSerieName and item.contentSeason and item.contentEpisodeNumber): head = ("%s - %sx%s | %s" % (item.contentSerieName, item.contentSeason, item.contentEpisodeNumber, config.get_localized_string(30163)))
else: head = config.get_localized_string(30163)
selection = platformtools.dialog_select(head, options, preselect= -1, useDetails=True)
if selection == -1:
return
else:
item = videolibrary.play(itemlist[selection + selection_implementation])[0]
item.play_from = 'window'
platformtools.play_video(item)
if (platformtools.is_playing() and item.action) or item.server == 'torrent' or config.get_setting('autoplay'): break
itemlist=[]
item.fromLibrary = True
logger.info()
logger.debug("item: \n" + item.tostring('\n'))
# logger.debug("item: \n" + item.tostring('\n'))
# We try to reproduce an image (this does nothing and also does not give an error)
# Try to reproduce an image (this does nothing and also does not give an error)
xbmcplugin.setResolvedUrl(int(sys.argv[1]), True, xbmcgui.ListItem(path=os.path.join(config.get_runtime_path(), "resources", "kod.mp4")))
xbmc.Player().stop()
# we modify the action (currently the video library needs "findvideos" since this is where the sources are searched
# Modify the action (currently the video library needs "findvideos" since this is where the sources are searched
item.action = "findvideos"
check_next_ep = nextep.check(item)
window_type = config.get_setting("window_type", "videolibrary")
# and we launch kodi again
# and launch kodi again
if xbmc.getCondVisibility('Window.IsMedia') and not window_type == 1:
# Conventional window
xbmc.executebuiltin("Container.Update(" + sys.argv[0] + "?" + item.tourl() + ")")
else:
# from core.support import dbg;dbg()
# Pop-up window
if config.get_setting('autoplay') and config.get_setting('hide_servers'):
item.show_server = False
else:
item.show_server = True
from specials import videolibrary, autoplay
p_dialog = platformtools.dialog_progress_bg(config.get_localized_string(20000), config.get_localized_string(60683))
p_dialog.update(0, '')
item.play_from = 'window'
itemlist = videolibrary.findvideos(item)
p_dialog.update(100, ''); sleep(0.5); p_dialog.close()
while platformtools.is_playing(): # Conventional window
sleep(1)
play_time = platformtools.resume_playback(item, True)
if not play_time:
return
# if not config.get_setting('autoplay'): show_server(item, itemlist, p_dialog)
if check_next_ep:
item.show_server = True
# p_dialog.update(100, '')
# sleep(0.5)
# p_dialog.close()
if not config.get_setting('autoplay'): show_server(item, itemlist, p_dialog)
item = nextep.return_item(item)
if item.next_ep: return play_from_library(item)
else:
while platformtools.is_playing(): # Conventional window
sleep(5)
p_dialog.update(50, '')
show_server(item, itemlist, p_dialog)
if item.show_server and check_next_ep:
nextep.run(item)
sleep(0.5)
p_dialog.close()
# The number of links to show is limited
if config.get_setting("max_links", "videolibrary") != 0: itemlist = limit_itemlist(itemlist)
# The list of links is slightly "cleaned"
if config.get_setting("replace_VD", "videolibrary") == 1: itemlist = reorder_itemlist(itemlist)
if len(itemlist) > 0:
while not xbmc.Monitor().abortRequested():
# The user chooses the mirror
options = []
selection_implementation = 0
for item in itemlist:
item.thumbnail = "https://github.com/kodiondemand/media/raw/master/resources/servers/" + item.server.lower() + '.png'
quality = '[B][' + item.quality + '][/B]' if item.quality else ''
if item.server:
it = xbmcgui.ListItem('\n[B]%s[/B] %s - %s' % (item.server, quality, item.contentTitle))
it.setArt({'thumb':item.thumbnail})
options.append(it)
else:
selection_implementation += 1
# The selection window opens
if (item.contentSerieName and item.contentSeason and item.contentEpisodeNumber): head = ("%s - %sx%s | %s" % (item.contentSerieName, item.contentSeason, item.contentEpisodeNumber, config.get_localized_string(30163)))
else: head = config.get_localized_string(30163)
selection = platformtools.dialog_select(head, options, preselect= -1, useDetails=True)
if selection == -1:
return
else:
item = videolibrary.play(itemlist[selection + selection_implementation])[0]
platformtools.play_video(item)
if (platformtools.is_playing() and item.action) or item.server == 'torrent' or config.get_setting('autoplay'): break

View File

@@ -548,7 +548,10 @@ def play_video(item, strm=False, force_direct=False, autoplay=False):
xlistitem.setProperty('inputstream.adaptive.manifest_type', 'mpd')
if force_direct: item.play_from = 'window'
set_player(item, xlistitem, mediaurl, view, strm)
nfo_path, head_nfo, item_nfo = resume_playback(item)
set_player(item, xlistitem, mediaurl, view, strm, nfo_path, head_nfo, item_nfo)
def stop_video():
@@ -876,9 +879,9 @@ def get_video_seleccionado(item, seleccion, video_urls):
return mediaurl, view, mpd
def set_player(item, xlistitem, mediaurl, view, strm):
def set_player(item, xlistitem, mediaurl, view, strm, nfo_path=None, head_nfo=None, item_nfo=None):
logger.info()
logger.debug("item:\n" + item.tostring('\n'))
# logger.debug("item:\n" + item.tostring('\n'))
# Moved del conector "torrent" here
if item.server == "torrent":
play_torrent(item, xlistitem, mediaurl)
@@ -914,7 +917,7 @@ def set_player(item, xlistitem, mediaurl, view, strm):
# if it is a video library file send to mark as seen
if strm or item.strm_path:
from platformcode import xbmc_videolibrary
xbmc_videolibrary.mark_auto_as_watched(item)
xbmc_videolibrary.mark_auto_as_watched(item, nfo_path, head_nfo, item_nfo)
xlistitem.setPath(mediaurl)
xbmcplugin.setResolvedUrl(int(sys.argv[1]), True, xlistitem)
xbmc.sleep(2500)
@@ -938,7 +941,7 @@ def set_player(item, xlistitem, mediaurl, view, strm):
# if it is a video library file send to mark as seen
if strm or item.strm_path:
from platformcode import xbmc_videolibrary
xbmc_videolibrary.mark_auto_as_watched(item)
xbmc_videolibrary.mark_auto_as_watched(item, nfo_path, head_nfo, item_nfo)
def torrent_client_installed(show_tuple=False):
@@ -998,4 +1001,89 @@ def play_torrent(item, xlistitem, mediaurl):
def log(texto):
xbmc.log(texto, xbmc.LOGNOTICE)
xbmc.log(texto, xbmc.LOGNOTICE)
def resume_playback(item, return_played_time=False):
class ResumePlayback(xbmcgui.WindowXMLDialog):
Close = False
Resume = False
def __init__(self, *args, **kwargs):
self.action_exitkeys_id = [xbmcgui.ACTION_BACKSPACE, xbmcgui.ACTION_PREVIOUS_MENU, xbmcgui.ACTION_NAV_BACK]
self.progress_control = None
self.item = kwargs.get('item')
m, s = divmod(float(self.item.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()
from core import videolibrarytools, filetools
# if nfo and strm_path not exist
if not item.nfo:
if item.contentType == 'movie':
vl = xbmc.translatePath(filetools.join(config.get_setting("videolibrarypath"), config.get_setting("folder_movies")))
path = '%s [%s]' % (item.contentTitle, item.infoLabels['IMDBNumber'])
item.nfo = filetools.join(vl, path, path + '.nfo')
if not item.strm_path: item.strm_path = filetools.join(path, item.contentTitle + '.strm')
else:
vl = xbmc.translatePath(filetools.join(config.get_setting("videolibrarypath"), config.get_setting("folder_tvshows")))
path = '%s [%s]' % (item.contentSerieName, item.infoLabels['IMDBNumber'])
item.nfo = filetools.join(vl, path, 'tvshow.nfo')
if item.contentSeason and item.contentEpisodeNumber:
title = str(item.contentSeason) + 'x' + str(item.contentEpisodeNumber).zfill(2)
else:
season, episode = scrapertools.find_single_match(item.title, r'(\d+)x(\d+)')
item.contentSeason = int(season)
item.contentEpisodeNumber = int(episode)
title = season + 'x' + episode.zfill(2)
if not item.strm_path: item.strm_path = filetools.join(path, title + '.strm')
# Read NFO FILE
if item.contentType == 'movie':
nfo_path = item.nfo
elif xbmc.translatePath(filetools.join(config.get_setting("videolibrarypath"), config.get_setting("folder_tvshows"))) in item.strm_path:
nfo_path = item.strm_path.replace('strm','nfo')
else:
nfo_path = xbmc.translatePath(filetools.join(config.get_setting("videolibrarypath"), config.get_setting("folder_tvshows"),item.strm_path.replace('strm','nfo')))
if filetools.isfile(nfo_path):
head_nfo, item_nfo = videolibrarytools.read_nfo(nfo_path)
if return_played_time:
return item_nfo.played_time
# Show Window
elif (config.get_setting("player_mode") not in [1, 3] or item.play_from == 'window') and item_nfo.played_time:
Dialog = ResumePlayback('ResumePlayback.xml', config.get_runtime_path(), item=item_nfo)
Dialog.show()
t = 0
while not Dialog.is_close() and t < 50:
t += 1
xbmc.sleep(100)
if not Dialog.Resume: item_nfo.played_time = 0
else:
item_nfo.played_time = 0
return nfo_path, head_nfo, item_nfo
else:
item.nfo = item.strm_path = ""
return None, None, None

View File

@@ -15,7 +15,7 @@ from core import scrapertools
from xml.dom import minidom
def mark_auto_as_watched(item):
def mark_auto_as_watched(item, nfo_path=None, head_nfo=None, item_nfo=None):
def mark_as_watched_subThread(item, nfo_path, head_nfo, item_nfo):
logger.info()
# logger.debug("item:\n" + item.tostring('\n'))
@@ -25,22 +25,54 @@ def mark_auto_as_watched(item):
time.sleep(1)
sync_with_trakt = False
next_episode = None
show_server = True
EXIT = False
percentage = float(config.get_setting("watched_setting")) / 100
while platformtools.is_playing():
time_from_end = config.get_setting('next_ep_seconds')
while platformtools.is_playing() and not EXIT:
actual_time = xbmc.Player().getTime()
totaltime = xbmc.Player().getTotalTime()
if item_nfo.played_time and actual_time < item_nfo.played_time:
total_time = xbmc.Player().getTotalTime()
if item_nfo.played_time and item_nfo.played_time > actual_time > 1:
xbmc.Player().seekTime(item_nfo.played_time)
mark_time = totaltime * percentage
mark_time = total_time * percentage
difference = total_time - actual_time
# Mark as Watched
if actual_time > mark_time:
logger.debug("Marked as Watched")
item.playcount = 1
sync_with_trakt = True
from specials import videolibrary
videolibrary.mark_content_as_watched2(item)
break
show_server = False
if item.contentType == 'movie' or not config.get_setting('next_ep'):
EXIT = True
# check for next Episode
if item.contentType != 'movie' and total_time > time_from_end >= difference:
next_dialogs = ['NextDialog.xml', 'NextDialogExtended.xml', 'NextDialogCompact.xml']
next_ep_type = config.get_setting('next_ep_type')
ND = next_dialogs[next_ep_type]
next_episode = next_ep(item)
if next_episode:
nextdialog = NextDialog(ND, config.get_runtime_path())
nextdialog.show()
while platformtools.is_playing() and not nextdialog.is_exit():
xbmc.sleep(100)
pass
EXIT = True
nextdialog.close()
if nextdialog.continuewatching:
next_episode.next_ep = True
else:
EXIT = True
if next_episode and next_episode.next_ep:
xbmc.Player().stop()
time.sleep(1)
@@ -51,91 +83,23 @@ def mark_auto_as_watched(item):
# Silent sync with Trakt
if sync_with_trakt and config.get_setting("trakt_sync"):sync_trakt_kodi()
while platformtools.is_playing():
xbmc.sleep(100)
if not show_server and item.play_from != 'window':
xbmc.sleep(700)
xbmc.executebuiltin('Action(Back)')
xbmc.sleep(500)
if next_episode:
if next_episode.next_ep:
from platformcode.launcher import play_from_library
return play_from_library(next_episode)
# If it is configured to mark as seen
if config.get_setting("mark_as_watched", "videolibrary"):
nfo_path, head_nfo, item_nfo = resume_playback(item)
threading.Thread(target=mark_as_watched_subThread, args=[item, nfo_path, head_nfo, item_nfo]).start()
def resume_playback(item):
class ResumePlayback(xbmcgui.WindowXMLDialog):
Close = False
Resume = False
def __init__(self, *args, **kwargs):
self.action_exitkeys_id = [xbmcgui.ACTION_BACKSPACE, xbmcgui.ACTION_PREVIOUS_MENU, xbmcgui.ACTION_NAV_BACK]
self.progress_control = None
self.item = kwargs.get('item')
m, s = divmod(float(self.item.played_time), 60)
h, m = divmod(m, 60)
self.setProperty("title", config.get_localized_string(30045) +' %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()
from core import videolibrarytools
# from core.support import dbg;dbg()
# if nfo and strm_path not exist
if not item.nfo:
if item.contentType == 'movie':
vl = xbmc.translatePath(filetools.join(config.get_setting("videolibrarypath"), config.get_setting("folder_movies")))
path = '%s [%s]' % (item.contentTitle, item.infoLabels['IMDBNumber'])
item.nfo = filetools.join(vl, path, path + '.nfo')
if not item.strm_path: item.strm_path = filetools.join(path, item.contentTitle + '.strm')
else:
vl = xbmc.translatePath(filetools.join(config.get_setting("videolibrarypath"), config.get_setting("folder_tvshows")))
path = '%s [%s]' % (item.contentSerieName, item.infoLabels['IMDBNumber'])
item.nfo = filetools.join(vl, path, 'tvshow.nfo')
if item.contentSeason and item.contentEpisodeNumber:
title = str(item.contentSeason) + 'x' + str(item.contentEpisodeNumber).zfill(2)
else:
season, episode = scrapertools.find_single_match(item.title, r'(\d+)x(\d+)')
item.contentSeason = int(season)
item.contentEpisodeNumber = int(episode)
title = season + 'x' + episode.zfill(2)
if not item.strm_path: item.strm_path = filetools.join(path, title + '.strm')
# Read NFO FILE
if item.contentType == 'movie':
nfo_path = item.nfo
elif xbmc.translatePath(filetools.join(config.get_setting("videolibrarypath"), config.get_setting("folder_tvshows"))) in item.strm_path:
nfo_path = item.strm_path.replace('strm','nfo')
else:
nfo_path = xbmc.translatePath(filetools.join(config.get_setting("videolibrarypath"), config.get_setting("folder_tvshows"),item.strm_path.replace('strm','nfo')))
head_nfo, item_nfo = videolibrarytools.read_nfo(nfo_path)
# Show Window
if (config.get_setting("player_mode") not in [3] or item.play_from == 'window') and item_nfo.played_time:
Dialog = ResumePlayback('ResumePlayback.xml', config.get_runtime_path(), item=item_nfo)
Dialog.show()
t = 0
while not Dialog.is_close() and t < 50:
t += 1
xbmc.sleep(100)
if not Dialog.Resume: item_nfo.played_time = 0
else:
item_nfo.played_time = 0
return nfo_path, head_nfo, item_nfo
def sync_trakt_addon(path_folder):
@@ -164,7 +128,7 @@ def sync_trakt_addon(path_folder):
shows = list(shows.items())
# we get the series id to compare
_id = re.findall("\[(.*?)\]", path_folder, flags=re.DOTALL)[0]
_id = re.findall(r"\[(.*?)\]", path_folder, flags=re.DOTALL)[0]
logger.debug("the id is %s" % _id)
if "tt" in _id:
@@ -206,7 +170,7 @@ def sync_trakt_addon(path_folder):
logger.debug("dict_trakt_show %s " % dict_trakt_show)
# we get the keys that are episodes
regex_epi = re.compile('\d+x\d+')
regex_epi = re.compile(r'\d+x\d+')
keys_episodes = [key for key in serie.library_playcounts if regex_epi.match(key)]
# we get the keys that are seasons
keys_seasons = [key for key in serie.library_playcounts if 'season ' in key]
@@ -330,7 +294,6 @@ def mark_content_as_watched_on_kodi(item, value=1):
path = filetools.join(tail, filename)
for d in data['result']['episodes']:
if d['file'].replace("/", "\\").endswith(path.replace("/", "\\")):
# logger.debug("I mark the episode as seen")
episodeid = d['episodeid']
@@ -430,7 +393,7 @@ def mark_content_as_watched_on_kod(path):
path1 = path.replace("\\\\", "\\") # Windows format
if not path2:
path2 = path1.replace("\\", "/") # Format no Windows
nfo_name = scrapertools.find_single_match(path2, '\]\/(.*?)$') # I build the name of the .nfo
nfo_name = scrapertools.find_single_match(path2, r'\]\/(.*?)$') # I build the name of the .nfo
path1 = path1.replace(nfo_name, '') # for SQL I just need the folder
path2 = path2.replace(nfo_name, '') # for SQL I just need the folder
path2 = filetools.remove_smb_credential(path2) # If the file is on an SMB server, we remove the credentials
@@ -448,7 +411,7 @@ def mark_content_as_watched_on_kod(path):
if contentType == "episode_view":
title_plain = title.replace('.strm', '') # If it is Serial, we remove the suffix .strm
else:
title_plain = scrapertools.find_single_match(item.strm_path, '.(.*?\s\[.*?\])') # if it's a movie, we remove the title
title_plain = scrapertools.find_single_match(item.strm_path, r'.(.*?\s\[.*?\])') # if it's a movie, we remove the title
if playCount is None or playCount == 0: # not yet seen, we set it to 0
playCount_final = 0
elif playCount >= 1:
@@ -463,7 +426,7 @@ def mark_content_as_watched_on_kod(path):
if item.infoLabels['mediatype'] == "tvshow": # We update the Season and Series playCounts
for season in item.library_playcounts:
if "season" in season: # we look for the tags "season" inside playCounts
season_num = int(scrapertools.find_single_match(season, 'season (\d+)')) # we save the season number
season_num = int(scrapertools.find_single_match(season, r'season (\d+)')) # we save the season number
item = videolibrary.check_season_playcount(item, season_num) # We call the method that updates Temps. and series
filetools.write(path, head_nfo + item.tojson())
@@ -551,7 +514,7 @@ def update(folder_content=config.get_setting("folder_tvshows"), folder=""):
# update_path = filetools.join(videolibrarypath, folder_content, folder) + "/" # Encoder problems in "folder"
update_path = filetools.join(videolibrarypath, folder_content, ' ').rstrip()
if videolibrarypath.startswith("special:") or not scrapertools.find_single_match(update_path, '(^\w+:\/\/)'):
if videolibrarypath.startswith("special:") or not scrapertools.find_single_match(update_path, r'(^\w+:\/\/)'):
payload["params"] = {"directory": update_path}
while xbmc.getCondVisibility('Library.IsScanningVideo()'):
@@ -593,7 +556,7 @@ def set_content(content_type, silent=False, custom=False):
if not xbmc.getCondVisibility('System.HasAddon(metadata.themoviedb.org)'):
if not silent:
# Ask if we want to install metadata.themoviedb.org
install = platformtools.dialog_yesno(config.get_localized_string(60046))
install = platformtools.dialog_yesno(config.get_localized_string(60046),'')
else:
install = True
@@ -617,7 +580,7 @@ def set_content(content_type, silent=False, custom=False):
continuar = False
if not silent:
# Ask if we want to install metadata.universal
install = platformtools.dialog_yesno(config.get_localized_string(70095))
install = platformtools.dialog_yesno(config.get_localized_string(70095),'')
else:
install = True
@@ -647,7 +610,7 @@ def set_content(content_type, silent=False, custom=False):
if not xbmc.getCondVisibility('System.HasAddon(metadata.tvdb.com)'):
if not silent:
#Ask if we want to install metadata.tvdb.com
install = platformtools.dialog_yesno(config.get_localized_string(60048))
install = platformtools.dialog_yesno(config.get_localized_string(60048),'')
else:
install = True
@@ -671,7 +634,7 @@ def set_content(content_type, silent=False, custom=False):
continuar = False
if not silent:
# Ask if we want to install metadata.tvshows.themoviedb.org
install = platformtools.dialog_yesno(config.get_localized_string(60050))
install = platformtools.dialog_yesno(config.get_localized_string(60050),'')
else:
install = True
@@ -705,7 +668,7 @@ def set_content(content_type, silent=False, custom=False):
if sql_videolibrarypath.startswith("special://"):
sql_videolibrarypath = sql_videolibrarypath.replace('/profile/', '/%/').replace('/home/userdata/', '/%/')
sep = '/'
elif scrapertools.find_single_match(sql_videolibrarypath, '(^\w+:\/\/)'):
elif scrapertools.find_single_match(sql_videolibrarypath, r'(^\w+:\/\/)'):
sep = '/'
else:
sep = os.sep
@@ -1282,4 +1245,113 @@ def ask_set_content(silent=False):
# configuration from the settings menu
else:
platformtools.dialog_ok(config.get_localized_string(80026), config.get_localized_string(80023))
do_config(True)
do_config(True)
def next_ep(item):
from core.item import Item
logger.info()
item.next_ep = False
if config.get_setting('next_ep'): # play next file if exist
# check if next file exist
current_filename = filetools.basename(item.strm_path)
base_path = filetools.basename(filetools.dirname(item.strm_path))
path = filetools.join(config.get_videolibrary_path(), config.get_setting("folder_tvshows"),base_path)
fileList = []
for file in filetools.listdir(path):
if file.endswith('.strm'):
fileList.append(file)
fileList.sort()
nextIndex = fileList.index(current_filename) + 1
if nextIndex == 0 or nextIndex == len(fileList):
next_file = None
else:
next_file = fileList[nextIndex]
logger.info('Next File:' + next_file)
# start next episode window afther x time
if next_file:
season_ep = next_file.split('.')[0]
season = season_ep.split('x')[0]
episode = season_ep.split('x')[1]
next_ep = '%sx%s' % (season, episode)
item = Item(
action= 'play_from_library',
channel= 'videolibrary',
contentEpisodeNumber= episode,
contentSeason= season,
contentTitle= next_ep,
contentType= 'episode',
infoLabels= {'episode': episode, 'mediatype': 'episode', 'season': season, 'title': next_ep},
strm_path= filetools.join(base_path, next_file),
play_from = item.play_from)
global INFO
INFO = filetools.join(path, next_file.replace("strm", "nfo"))
# logger.info('Next Info:\n' + str(INFO))
return item
class NextDialog(xbmcgui.WindowXMLDialog):
item = None
cancel = False
EXIT = False
continuewatching = True
def __init__(self, *args, **kwargs):
self.action_exitkeys_id = [xbmcgui.ACTION_STOP, xbmcgui.ACTION_BACKSPACE, xbmcgui.ACTION_PREVIOUS_MENU, xbmcgui.ACTION_NAV_BACK]
self.progress_control = None
# set info
f = filetools.file_open(INFO, 'r')
full_info = f.read().split('\n')
full_info = full_info[1:]
f.close()
full_info = "".join(full_info)
info = jsontools.load(full_info)
if "thumbnail" in info:
img = info["thumbnail"]
else:
img = filetools.join(config.get_runtime_path(), "resources", "noimage.png")
self.setProperty("next_img", img)
info = info["infoLabels"]
self.setProperty("title", info["tvshowtitle"])
self.setProperty("ep_title", "%dx%02d - %s" % (info["season"], info["episode"], info["title"]))
def set_exit(self, EXIT):
self.EXIT = EXIT
def set_continue_watching(self, continuewatching):
self.continuewatching = continuewatching
def is_exit(self):
return self.EXIT
def onFocus(self, controlId):
pass
def doAction(self):
pass
def closeDialog(self):
self.close()
def onClick(self, controlId):
if controlId == 3012: # Still watching
self.set_exit(True)
self.set_continue_watching(True)
self.close()
elif controlId == 3013: # Cancel
self.set_exit(True)
self.set_continue_watching(False)
self.close()
def onAction(self, action):
if action in self.action_exitkeys_id:
self.set_exit(True)
self.set_continue_watching(False)
self.close()

View File

@@ -195,6 +195,10 @@ msgctxt "#30045"
msgid "Resume from:"
msgstr ""
msgctxt "#30046"
msgid "Resume from start"
msgstr ""
msgctxt "#30050"
msgid "Server connection error"
msgstr ""

View File

@@ -195,6 +195,10 @@ msgctxt "#30045"
msgid "Resume from:"
msgstr "Riprendi da:"
msgctxt "#30046"
msgid "Resume from start"
msgstr "Riprendi dall'inizio"
msgctxt "#30050"
msgid "Server connection error"
msgstr "Errore connessione server"

View File

@@ -20,7 +20,7 @@
<setting id="player_mode" type="select" lvalues="30026|30027|30028|30029" label="30044" default="1"/>
<setting id="default_action" type="select" 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)" subsetting="true"/>
<!-- <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"/>
</category>
@@ -35,10 +35,10 @@
<setting id="videolibrary_kodi" type="bool" label="70120" default="false"/>
<setting label="59997" type="lsep"/>
<setting id="videolibrary_max_quality" type="bool" label="70729" default="false" visible="true"/>
<setting id="next_ep" type="select" label="70746" lvalues="70752|70747|70748" default="0"/>
<setting id="next_ep_type" type="select" label="70754" lvalues="70755|70756|70757" default="0" visible="eq(-1,2)" subsetting="true"/>
<setting id="next_ep_seconds" type="slider" option="int" range="20,10,120" label="70749" default="40" visible="!eq(-2,0)" subsetting="true"/>
<setting id="watched_setting" type="slider" option="int" range="20,10,100" label="60634" default="80"/>
<setting id="next_ep" type="bool" label="70746" default="true"/>
<setting id="next_ep_type" type="select" label="70754" lvalues="70755|70756|70757" default="0" visible="eq(-1,true)" subsetting="true"/>
<setting id="next_ep_seconds" type="slider" option="int" range="20,10,240" label="70749" default="40" visible="eq(-2,true)" subsetting="true"/>
<setting id="watched_setting" type="slider" option="int" range="20,10,90" label="60634" default="80"/>
<setting id="trakt_sync" type="bool" label="70109" default="false"/>
<setting label="30030" type="lsep"/>
<setting id="vidolibrary_preferences" type="action" label="60542" action="RunPlugin(plugin://plugin.video.kod/?ew0KICAgICJhY3Rpb24iOiAiY2hhbm5lbF9jb25maWciLA0KICAgICJjaGFubmVsIjogInZpZGVvbGlicmFyeSINCn0==)"/>

View File

@@ -19,7 +19,7 @@
<control type="image">
<width>100%</width>
<height>100%</height>
<texture colordiffuse="FF232323">Shortcut/white.png</texture>
<texture colordiffuse="FF232323">white.png</texture>
</control>
<!-- Divider -->
<control type="image">
@@ -27,7 +27,7 @@
<right>0</right>
<width>100%</width>
<height>1</height>
<texture colordiffuse="33FFFFFF">Shortcut/white.png</texture>
<texture colordiffuse="33FFFFFF">white.png</texture>
</control>
<!-- Header -->
<control type="label" id="10002">
@@ -47,8 +47,8 @@
<top>25</top>
<width>30</width>
<height>30</height>
<texturefocus colordiffuse="FFFFFFFF">Controls/DialogCloseButton-focus.png</texturefocus>
<texturenofocus colordiffuse="55FFFFFF">Controls/DialogCloseButton-focus.png</texturenofocus>
<texturefocus colordiffuse="FFFFFFFF">close.png</texturefocus>
<texturenofocus colordiffuse="55FFFFFF">close.png</texturenofocus>
</control>
<!-- OK -->
<control type="button" id="10004">
@@ -58,8 +58,8 @@
<height>60</height>
<textwidth>110</textwidth>
<textcolor>FFFFFFFF</textcolor>
<texturefocus colordiffuse="FF0081C2">Shortcut/white.png</texturefocus>
<texturenofocus colordiffuse="FF191919">Shortcut/white.png</texturenofocus>
<texturefocus colordiffuse="FF0081C2">white.png</texturefocus>
<texturenofocus colordiffuse="FF191919">white.png</texturenofocus>
<align>center</align>
<aligny>center</aligny>
<label>$ADDON[plugin.video.kod 70001]</label>
@@ -72,8 +72,8 @@
<height>60</height>
<textwidth>110</textwidth>
<textcolor>FFFFFFFF</textcolor>
<texturefocus colordiffuse="FF0081C2">Shortcut/white.png</texturefocus>
<texturenofocus colordiffuse="FF191919">Shortcut/white.png</texturenofocus>
<texturefocus colordiffuse="FF0081C2">white.png</texturefocus>
<texturenofocus colordiffuse="FF191919">white.png</texturenofocus>
<align>center</align>
<aligny>center</aligny>
<label>$ADDON[plugin.video.kod 70002]</label>
@@ -86,8 +86,8 @@
<height>60</height>
<textwidth>110</textwidth>
<textcolor>FFFFFFFF</textcolor>
<texturefocus colordiffuse="FF0081C2">Shortcut/white.png</texturefocus>
<texturenofocus colordiffuse="FF191919">Shortcut/white.png</texturenofocus>
<texturefocus colordiffuse="FF0081C2">white.png</texturefocus>
<texturenofocus colordiffuse="FF191919">white.png</texturenofocus>
<align>center</align>
<aligny>center</aligny>
<label>$ADDON[plugin.video.kod 70003]</label>
@@ -116,14 +116,14 @@
<right>0</right>
<width>10</width>
<height>540</height>
<texture border="2" colordiffuse="FF232323">Shortcut/white.png</texture>
<texture border="2" colordiffuse="FF232323">white.png</texture>
</control>
<control type="image" id="10009">
<top>120</top>
<right>0</right>
<width>10</width>
<height>540</height>
<texture border="2" colordiffuse="33FFFFFF">Shortcut/white.png</texture>
<texture border="2" colordiffuse="33FFFFFF">white.png</texture>
</control>
</control>
</controls>

View File

@@ -12,8 +12,8 @@
<top>0</top>
<width>100%</width>
<height>100%</height>
<texturefocus colordiffuse="80DCDCDC">Shortcut/white.png</texturefocus>
<texturenofocus colordiffuse="80DCDCDC">Shortcut/white.png</texturenofocus>
<texturefocus colordiffuse="80DCDCDC">white.png</texturefocus>
<texturenofocus colordiffuse="80DCDCDC">white.png</texturenofocus>
<animation effect="fade" time="200">WindowOpen</animation>
<animation effect="fade" time="200">WindowClose</animation>
<onclick>Action(close)</onclick>
@@ -39,9 +39,9 @@
<top>219</top>
<width>1100</width>
<height>10</height>
<texturesliderbackground colordiffuse="FFDCDCDC">Shortcut/white.png</texturesliderbackground>
<texturesliderbar colordiffuse="FF1f1f1f">Shortcut/white.png</texturesliderbar>
<texturesliderbarfocus colordiffuse="FF0082C2">Shortcut/white.png</texturesliderbarfocus>
<texturesliderbackground colordiffuse="FFDCDCDC">white.png</texturesliderbackground>
<texturesliderbar colordiffuse="FF1f1f1f">white.png</texturesliderbar>
<texturesliderbarfocus colordiffuse="FF0082C2">white.png</texturesliderbarfocus>
<showonepage>false</showonepage>
<orientation>horizontal</orientation>
<ondown>32500</ondown>
@@ -50,7 +50,7 @@
<control type="image">
<width>1100</width>
<height>218</height>
<texture colordiffuse="FFDCDCDC">Shortcut/white.png</texture>
<texture colordiffuse="FFDCDCDC">white.png</texture>
</control>
<control type="list" id="32500">
<left>-130</left>
@@ -78,7 +78,7 @@
<top>1</top>
<width>220</width>
<height>218</height>
<texture colordiffuse="FF0082C2">Shortcut/white.png</texture>
<texture colordiffuse="FF0082C2">white.png</texture>
</control>
<control type="textbox">
<left>0</left>

View File

@@ -18,7 +18,7 @@
<control type="image">
<width>100%</width>
<height>100%</height>
<texture colordiffuse="FF232323">Shortcut/white.png</texture>
<texture colordiffuse="FF232323">white.png</texture>
</control>
<!-- FANART -->
<control type="image" id="10004">
@@ -47,8 +47,8 @@
<top>25</top>
<width>30</width>
<height>30</height>
<texturefocus colordiffuse="FFFFFFFF">Controls/DialogCloseButton-focus.png</texturefocus>
<texturenofocus colordiffuse="55FFFFFF">Controls/DialogCloseButton-focus.png</texturenofocus>
<texturefocus colordiffuse="FFFFFFFF">close.png</texturefocus>
<texturenofocus colordiffuse="55FFFFFF">close.png</texturenofocus>
</control>
<!-- LOCANDINA -->
<control type="image" id="10005">
@@ -315,8 +315,8 @@
<width>200</width>
<height>50</height>
<textwidth>110</textwidth>
<texturefocus colordiffuse="FF0081C2">Shortcut/white.png</texturefocus>
<texturenofocus colordiffuse="000081C2">Shortcut/white.png</texturenofocus>
<texturefocus colordiffuse="FF0081C2">white.png</texturefocus>
<texturenofocus colordiffuse="000081C2">white.png</texturenofocus>
<align>center</align>
<aligny>center</aligny>
<label>$ADDON[plugin.video.kod 70005]</label>
@@ -327,8 +327,8 @@
<width>200</width>
<height>50</height>
<textwidth>110</textwidth>
<texturefocus colordiffuse="FF0081C2">Shortcut/white.png</texturefocus>
<texturenofocus colordiffuse="000081C2">Shortcut/white.png</texturenofocus>
<texturefocus colordiffuse="FF0081C2">white.png</texturefocus>
<texturenofocus colordiffuse="000081C2">white.png</texturenofocus>
<align>center</align>
<aligny>center</aligny>
<label>$ADDON[plugin.video.kod 70006]</label>
@@ -339,8 +339,8 @@
<width>200</width>
<height>50</height>
<textwidth>110</textwidth>
<texturefocus colordiffuse="FF0081C2">Shortcut/white.png</texturefocus>
<texturenofocus colordiffuse="000081C2">Shortcut/white.png</texturenofocus>
<texturefocus colordiffuse="FF0081C2">white.png</texturefocus>
<texturenofocus colordiffuse="000081C2">white.png</texturenofocus>
<align>center</align>
<aligny>center</aligny>
<label>$ADDON[plugin.video.kod 70002]</label>
@@ -351,8 +351,8 @@
<width>200</width>
<height>50</height>
<textwidth>110</textwidth>
<texturefocus colordiffuse="FF0081C2">Shortcut/white.png</texturefocus>
<texturenofocus colordiffuse="000081C2">Shortcut/white.png</texturenofocus>
<texturefocus colordiffuse="FF0081C2">white.png</texturefocus>
<texturenofocus colordiffuse="000081C2">white.png</texturenofocus>
<align>center</align>
<aligny>center</aligny>
<label>$ADDON[plugin.video.kod 70007]</label>

View File

@@ -5,82 +5,60 @@
<onload>Dialog.Close(videoosd,true)</onload>
<controls>
<control type="group">
<top>0</top>
<right>0</right>
<width>100%</width>
<animation type="WindowOpen" reversible="false">
<effect type="fade" start="0" end="100" time="600" />
<effect type="slide" start="115,0" end="0,0" time="600" />
<effect type="fade" start="0" end="100" time="400" />
<effect type="slide" start="115,0" end="0,0" time="400" />
</animation>
<animation type="WindowClose" reversible="false">
<effect type="fade" start="100" end="0" time="400" />
<effect type="slide" start="0,0" end="115,0" time="400" />
<effect type="fade" start="100" end="0" time="300" />
<effect type="slide" start="0,0" end="115,0" time="300" />
</animation>
<control type="group">
<right>0</right>
<control type="grouplist" id="20">
<orientation>horizontal</orientation>
<top>15</top>
<height>40</height>
<width>100%</width>
<!-- Background -->
<control type="image">
<top>0</top>
<width>100%</width>
<itemgap>0</itemgap>
<align>right</align>
<control type="button" id="3012">
<label>$INFO[Window.Property(title)] - $INFO[Window.Property(ep_title)] | $INFO[Player.TimeRemaining(secs),,]</label>
<height>40</height>
<texture colordiffuse="00111111">NextDialog/background-diffuse.png</texture>
<width min="50">auto</width>
<font>font30_title</font>
<textoffsetx>20</textoffsetx>
<textcolor>80FFFFFF</textcolor>
<focusedcolor>FFFFFFFF</focusedcolor>
<selectedcolor>80FFFFFF</selectedcolor>
<shadowcolor>22000000</shadowcolor>
<aligny>center</aligny>
<align>center</align>
<texturefocus border="10" colordiffuse="88232323">white.png</texturefocus>
<texturenofocus border="10" colordiffuse="88232323">white.png</texturenofocus>
<pulseonselect>no</pulseonselect>
</control>
<control type="group">
<control type="button" id="3013">
<label>$ADDON[plugin.video.kod 60396]</label>
<height>40</height>
<width min="50">auto</width>
<font>font30_title</font>
<textoffsetx>20</textoffsetx>
<textcolor>80FFFFFF</textcolor>
<focusedcolor>FFFFFFFF</focusedcolor>
<selectedcolor>80FFFFFF</selectedcolor>
<shadowcolor>22000000</shadowcolor>
<aligny>center</aligny>
<align>center</align>
<texturefocus border="10" colordiffuse="88232323">white.png</texturefocus>
<texturenofocus border="10" colordiffuse="88232323">white.png</texturenofocus>
<pulseonselect>no</pulseonselect>
</control>
<control type="image">
<top>0</top>
<right>0</right>
<width>100%</width>
<!-- buttons -->
<control type="button" id="3012">
<left>-1000</left>
<top>-1000</top>
<height>1</height>
<width>1</width>
</control>
<control type="grouplist" id="20">
<orientation>horizontal</orientation>
<height>40</height>
<itemgap>0</itemgap>
<align>right</align>
<control type="button" id="11">
<label>$INFO[Window.Property(title)] | $INFO[Window.Property(ep_title)] | $INFO[Player.TimeRemaining(secs),,]</label>
<onclick>SendClick(3012)</onclick>
<height>40</height>
<width min="50">auto</width>
<font>font30_title</font>
<textoffsetx>20</textoffsetx>
<textcolor>80FFFFFF</textcolor>
<focusedcolor>FFFFFFFF</focusedcolor>
<selectedcolor>80FFFFFF</selectedcolor>
<shadowcolor>22000000</shadowcolor>
<aligny>center</aligny>
<align>center</align>
<texturefocus border="10" colordiffuse="88232323">NextDialog/background-diffuse.png</texturefocus>
<texturenofocus border="10" colordiffuse="88232323">NextDialog/background-diffuse.png</texturenofocus>
<pulseonselect>no</pulseonselect>
</control>
<control type="button" id="3013">
<label>$ADDON[plugin.video.kod 60396]</label>
<height>40</height>
<width min="50">auto</width>
<font>font30_title</font>
<textoffsetx>20</textoffsetx>
<textcolor>80FFFFFF</textcolor>
<focusedcolor>FFFFFFFF</focusedcolor>
<selectedcolor>80FFFFFF</selectedcolor>
<shadowcolor>22000000</shadowcolor>
<aligny>center</aligny>
<align>center</align>
<texturefocus border="10" colordiffuse="88232323">NextDialog/background-diffuse.png</texturefocus>
<texturenofocus border="10" colordiffuse="88232323">NextDialog/background-diffuse.png</texturenofocus>
<pulseonselect>no</pulseonselect>
</control>
<control type="image">
<top>0</top>
<width>30</width>
<height>40</height>
<texture colordiffuse="88232323">NextDialog/background-diffuse.png</texture>
</control>
</control>
<width>30</width>
<height>40</height>
<texture colordiffuse="88232323">white.png</texture>
</control>
</control>
</control>

View File

@@ -4,85 +4,57 @@
<onload>Dialog.Close(fullscreeninfo,true)</onload>
<onload>Dialog.Close(videoosd,true)</onload>
<controls>
<control type="group">
<control type="grouplist" id="20">
<orientation>horizontal</orientation>
<top>15</top>
<height>40</height>
<itemgap>0</itemgap>
<align>right</align>
<animation type="WindowOpen" reversible="false">
<effect type="fade" start="0" end="100" time="600" />
<effect type="slide" start="115,0" end="0,0" time="600" />
<effect type="fade" start="0" end="100" time="400" />
<effect type="slide" start="115,0" end="0,0" time="400" />
</animation>
<animation type="WindowClose" reversible="false">
<effect type="fade" start="100" end="0" time="400" />
<effect type="slide" start="0,0" end="115,0" time="400" />
<effect type="fade" start="100" end="0" time="300" />
<effect type="slide" start="0,0" end="115,0" time="300" />
</animation>
<control type="group">
<right>0</right>
<top>15</top>
<height>50</height>
<width>100%</width>
<!-- Background -->
<control type="button" id="3012">
<label>[B]$INFO[Player.TimeRemaining(secs),,][/B]</label>
<height>40</height>
<width>80</width>
<font>font30_title</font>
<textoffsetx>10</textoffsetx>
<textcolor>80FFFFFF</textcolor>
<focusedcolor>FFFFFFFF</focusedcolor>
<selectedcolor>80FFFFFF</selectedcolor>
<shadowcolor>22000000</shadowcolor>
<aligny>center</aligny>
<align>left</align>
<texturefocus border="0" colordiffuse="FFFFFFFF">NextDialog/play.png</texturefocus>
<texturenofocus border="0" colordiffuse="80FFFFFF">NextDialog/play.png</texturenofocus>
<pulseonselect>no</pulseonselect>
</control>
<control type="button" id="3013">
<label></label>
<height>40</height>
<width>40</width>
<font>font30_title</font>
<textoffsetx>30</textoffsetx>
<textcolor>80FFFFFF</textcolor>
<focusedcolor>FFFFFFFF</focusedcolor>
<selectedcolor>80FFFFFF</selectedcolor>
<shadowcolor>22000000</shadowcolor>
<aligny>center</aligny>
<align>center</align>
<texturefocus border="10" colordiffuse="FFFFFFFF">NextDialog/close.png</texturefocus>
<texturenofocus border="10" colordiffuse="80FFFFFF">NextDialog/close.png</texturenofocus>
<pulseonselect>no</pulseonselect>
</control>
<control type="image">
<top>0</top>
<width>100%</width>
<height>40</height>
<!-- <texture colordiffuse="00111111">NextDialog/button-bg.png</texture> -->
</control>
<control type="group">
<top>0</top>
<right>0</right>
<width>100%</width>
<!-- buttons -->
<control type="button" id="3012">
<left>-1000</left>
<top>-1000</top>
<height>1</height>
<width>1</width>
</control>
<control type="grouplist" id="20">
<orientation>horizontal</orientation>
<height>40</height>
<itemgap>0</itemgap>
<align>right</align>
<control type="button" id="11">
<label>[B]$INFO[Player.TimeRemaining(secs),,][/B]</label>
<onclick>SendClick(3012)</onclick>
<!-- <visible>!Integer.IsGreater(Player.TimeRemaining,59)</visible> -->
<height>40</height>
<width>100</width>
<font>font30_title</font>
<textoffsetx>12</textoffsetx>
<textcolor>80FFFFFF</textcolor>
<focusedcolor>FFFFFFFF</focusedcolor>
<selectedcolor>80FFFFFF</selectedcolor>
<shadowcolor>22000000</shadowcolor>
<aligny>center</aligny>
<align>left</align>
<texturefocus border="10">NextDialog/play-fo.png</texturefocus>
<texturenofocus border="10">NextDialog/play-nf.png</texturenofocus>
<pulseonselect>no</pulseonselect>
</control>
<control type="button" id="3013">
<label></label>
<height>40</height>
<width>40</width>
<font>font30_title</font>
<textoffsetx>30</textoffsetx>
<textcolor>80FFFFFF</textcolor>
<focusedcolor>FFFFFFFF</focusedcolor>
<selectedcolor>80FFFFFF</selectedcolor>
<shadowcolor>22000000</shadowcolor>
<aligny>center</aligny>
<align>center</align>
<texturefocus border="10">NextDialog/close-fo.png</texturefocus>
<texturenofocus border="10">NextDialog/close-nf.png</texturenofocus>
<pulseonselect>no</pulseonselect>
</control>
<control type="image">
<top>0</top>
<width>20</width>
<height>40</height>
<texture>NextDialog/background.png</texture>
</control>
</control>
</control>
<top>0</top>
<width>20</width>
<height>40</height>
<texture>NextDialog/background.png</texture>
</control>
</control>
</controls>

View File

@@ -6,12 +6,12 @@
<controls>
<control type="group">
<animation type="WindowOpen" reversible="false">
<effect type="fade" start="0" end="100" time="600" />
<effect type="slide" start="115,0" end="0,0" time="600" />
<effect type="fade" start="0" end="100" time="400" />
<effect type="slide" start="115,0" end="0,0" time="400" />
</animation>
<animation type="WindowClose" reversible="false">
<effect type="fade" start="100" end="0" time="400" />
<effect type="slide" start="0,0" end="115,0" time="400" />
<effect type="fade" start="100" end="0" time="300" />
<effect type="slide" start="0,0" end="115,0" time="300" />
</animation>
<control type="group">
<right>30</right>
@@ -26,59 +26,47 @@
<height>180</height>
<texture>$INFO[Window.Property(next_img)]</texture>
</control>
<control type="group">
<top>0</top>
<control type="grouplist" id="20">
<orientation>vertical</orientation>
<height>220</height>
<width>326</width>
<itemgap>0</itemgap>
<right>0</right>
<width>100%</width>
<!-- buttons -->
<control type="button" id="3012">
<left>-1000</left>
<top>-1000</top>
<height>1</height>
<width>1</width>
</control>
<control type="grouplist" id="20">
<orientation>vertical</orientation>
<height>220</height>
<width>326</width>
<itemgap>0</itemgap>
<label></label>
<height>180</height>
<width>326</width>
<right>0</right>
<control type="button" id="11">
<label></label>
<onclick>SendClick(3012)</onclick>
<height>180</height>
<width>326</width>
<right>0</right>
<font>font30_title</font>
<textoffsety>20</textoffsety>
<textcolor>FFFFFFFF</textcolor>
<focusedcolor>FFFFFFFF</focusedcolor>
<selectedcolor>FFFFFFFF</selectedcolor>
<shadowcolor>22000000</shadowcolor>
<aligny>top</aligny>
<align>center</align>
<texturefocus border="10">NextDialog/background-play.png</texturefocus>
<texturenofocus border="10" colordiffuse="00232323">NextDialog/background-diffuse.png</texturenofocus>
<pulseonselect>no</pulseonselect>
</control>
<control type="button" id="3013">
<label>$ADDON[plugin.video.kod 60396]</label>
<height>40</height>
<width>326</width>
<font>font30_title</font>
<textoffsetx>20</textoffsetx>
<textcolor>80FFFFFF</textcolor>
<focusedcolor>FFFFFFFF</focusedcolor>
<selectedcolor>80FFFFFF</selectedcolor>
<shadowcolor>22000000</shadowcolor>
<aligny>center</aligny>
<align>center</align>
<texturefocus border="10" colordiffuse="88232323">NextDialog/background-diffuse.png</texturefocus>
<texturenofocus border="10" colordiffuse="88232323">NextDialog/background-diffuse.png</texturenofocus>
<pulseonselect>no</pulseonselect>
</control>
<font>font30_title</font>
<textoffsety>20</textoffsety>
<textcolor>FFFFFFFF</textcolor>
<focusedcolor>FFFFFFFF</focusedcolor>
<selectedcolor>FFFFFFFF</selectedcolor>
<shadowcolor>22000000</shadowcolor>
<aligny>top</aligny>
<align>center</align>
<texturefocus border="10">NextDialog/background-play.png</texturefocus>
<texturenofocus border="10" colordiffuse="00232323">white.png</texturenofocus>
<pulseonselect>no</pulseonselect>
</control>
<control type="label">
<control type="button" id="3013">
<label>$ADDON[plugin.video.kod 60396]</label>
<height>40</height>
<width>326</width>
<font>font30_title</font>
<textoffsetx>20</textoffsetx>
<textcolor>80FFFFFF</textcolor>
<focusedcolor>FFFFFFFF</focusedcolor>
<selectedcolor>FFFFFFFF</selectedcolor>
<shadowcolor>22000000</shadowcolor>
<aligny>center</aligny>
<align>center</align>
<texturefocus border="10" colordiffuse="FF0082C2">white.png</texturefocus>
<texturenofocus border="10" colordiffuse="FF232323">white.png</texturenofocus>
<pulseonselect>no</pulseonselect>
</control>
</control>
<control type="label">
<bottom>60</bottom>
<height>40</height>
<aligny>center</aligny>
@@ -86,12 +74,12 @@
<align>center</align>
<scroll>true</scroll>
<scrollspeed>50</scrollspeed>
<textcolor>FFFFFFFF</textcolor>
<shadowcolor>ff000000</shadowcolor>
<textcolor>FFFFFFFF</textcolor>
<shadowcolor>FF000000</shadowcolor>
<info>Window.Property(title)</info>
<font>font30_title</font>
</control>
<control type="label">
<control type="label">
<bottom>40</bottom>
<height>40</height>
<aligny>center</aligny>
@@ -99,26 +87,25 @@
<align>center</align>
<scroll>true</scroll>
<scrollspeed>50</scrollspeed>
<textcolor>FFFFFFFF</textcolor>
<shadowcolor>ff000000</shadowcolor>
<textcolor>FFFFFFFF</textcolor>
<shadowcolor>FF000000</shadowcolor>
<info>Window.Property(ep_title)</info>
<font>font20_title</font>
</control>
<control type="label">
<control type="label">
<top>20</top>
<right>25</right>
<right>25</right>
<height>auto</height>
<aligny>top</aligny>
<visible>true</visible>
<align>right</align>
<scroll>true</scroll>
<scrollspeed>50</scrollspeed>
<textcolor>FFFFFFFF</textcolor>
<shadowcolor>ff000000</shadowcolor>
<textcolor>FFFFFFFF</textcolor>
<shadowcolor>FF000000</shadowcolor>
<info>Player.TimeRemaining(secs),,</info>
<font>font30_title</font>
</control>
</control>
</control>
</control>
</controls>

View File

@@ -19,7 +19,7 @@
<width>510</width>
<height>640</height>
<left>45</left>
<texture>Shortcut/dialog-bg-solid.png</texture>
<texture>Controls/dialog-bg-solid.png</texture>
</control>
<control type="textbox" id="10000">
<top>30</top>
@@ -39,8 +39,8 @@
<textwidth>110</textwidth>
<textcolor>FFFFFFFF</textcolor>
<focusedcolor>FFFFFFFF</focusedcolor>
<texturefocus>Controls/KeyboardKey.png</texturefocus>
<texturenofocus>Controls/KeyboardKeyNF.png</texturenofocus>
<texturefocus colordiffuse="FF0082C2">white.png</texturefocus>
<texturenofocus colordiffuse="000082C2">white.png</texturenofocus>
<align>center</align>
<aligny>center</aligny>
<label>$ADDON[plugin.video.kod 70007]</label>
@@ -57,8 +57,8 @@
<textwidth>110</textwidth>
<textcolor>FFFFFFFF</textcolor>
<focusedcolor>FFFFFFFF</focusedcolor>
<texturefocus>Controls/KeyboardKey.png</texturefocus>
<texturenofocus>Controls/KeyboardKeyNF.png</texturenofocus>
<texturefocus colordiffuse="FF0082C2">white.png</texturefocus>
<texturenofocus colordiffuse="000082C2">white.png</texturenofocus>
<align>center</align>
<aligny>center</aligny>
<label>$ADDON[plugin.video.kod 707433]</label>
@@ -75,8 +75,8 @@
<textwidth>110</textwidth>
<textcolor>FFFFFFFF</textcolor>
<focusedcolor>FFFFFFFF</focusedcolor>
<texturefocus>Controls/KeyboardKey.png</texturefocus>
<texturenofocus>Controls/KeyboardKeyNF.png</texturenofocus>
<texturefocus colordiffuse="FF0082C2">white.png</texturefocus>
<texturenofocus colordiffuse="000082C2">white.png</texturenofocus>
<align>center</align>
<aligny>center</aligny>
<label>$ADDON[plugin.video.kod 70008]</label>
@@ -96,9 +96,9 @@
<left>75</left>
<width>150</width>
<height>150</height>
<texturefocus colordiffuse="AA232323">Controls/background-diffuse.png</texturefocus>
<texturenofocus colordiffuse="00232323">Controls/background-diffuse.png</texturenofocus>
<alttexturefocus colordiffuse="FF232323">Controls/check_mark.png</alttexturefocus>
<texturefocus colordiffuse="AA232323">white.png</texturefocus>
<texturenofocus colordiffuse="00232323">white.png</texturenofocus>
<alttexturefocus colordiffuse="FF0082C2">Controls/check_mark.png</alttexturefocus>
<alttexturenofocus colordiffuse="FFFFFFFF">Controls/check_mark.png</alttexturenofocus>
<onup>10002</onup>
<ondown>10008</ondown>
@@ -110,9 +110,9 @@
<left>225</left>
<width>150</width>
<height>150</height>
<texturefocus colordiffuse="AA232323">Controls/background-diffuse.png</texturefocus>
<texturenofocus colordiffuse="00232323">Controls/background-diffuse.png</texturenofocus>
<alttexturefocus colordiffuse="FF232323">Controls/check_mark.png</alttexturefocus>
<texturefocus colordiffuse="AA232323">white.png</texturefocus>
<texturenofocus colordiffuse="00232323">white.png</texturenofocus>
<alttexturefocus colordiffuse="FF0082C2">Controls/check_mark.png</alttexturefocus>
<alttexturenofocus colordiffuse="FFFFFFFF">Controls/check_mark.png</alttexturenofocus>
<onup>10003</onup>
<ondown>10009</ondown>
@@ -124,9 +124,9 @@
<left>375</left>
<width>150</width>
<height>150</height>
<texturefocus colordiffuse="AA232323">Controls/background-diffuse.png</texturefocus>
<texturenofocus colordiffuse="00232323">Controls/background-diffuse.png</texturenofocus>
<alttexturefocus colordiffuse="FF232323">Controls/check_mark.png</alttexturefocus>
<texturefocus colordiffuse="AA232323">white.png</texturefocus>
<texturenofocus colordiffuse="00232323">white.png</texturenofocus>
<alttexturefocus colordiffuse="FF0082C2">Controls/check_mark.png</alttexturefocus>
<alttexturenofocus colordiffuse="FFFFFFFF">Controls/check_mark.png</alttexturenofocus>
<onup>10004</onup>
<ondown>10010</ondown>
@@ -138,9 +138,9 @@
<left>75</left>
<width>150</width>
<height>150</height>
<texturefocus colordiffuse="AA232323">Controls/background-diffuse.png</texturefocus>
<texturenofocus colordiffuse="00232323">Controls/background-diffuse.png</texturenofocus>
<alttexturefocus colordiffuse="FF232323">Controls/check_mark.png</alttexturefocus>
<texturefocus colordiffuse="AA232323">white.png</texturefocus>
<texturenofocus colordiffuse="00232323">white.png</texturenofocus>
<alttexturefocus colordiffuse="FF0082C2">Controls/check_mark.png</alttexturefocus>
<alttexturenofocus colordiffuse="FFFFFFFF">Controls/check_mark.png</alttexturenofocus>
<onup>10005</onup>
<ondown>10011</ondown>
@@ -152,9 +152,9 @@
<left>225</left>
<width>150</width>
<height>150</height>
<texturefocus colordiffuse="AA232323">Controls/background-diffuse.png</texturefocus>
<texturenofocus colordiffuse="00232323">Controls/background-diffuse.png</texturenofocus>
<alttexturefocus colordiffuse="FF232323">Controls/check_mark.png</alttexturefocus>
<texturefocus colordiffuse="AA232323">white.png</texturefocus>
<texturenofocus colordiffuse="00232323">white.png</texturenofocus>
<alttexturefocus colordiffuse="FF0082C2">Controls/check_mark.png</alttexturefocus>
<alttexturenofocus colordiffuse="FFFFFFFF">Controls/check_mark.png</alttexturenofocus>
<onup>10006</onup>
<ondown>10012</ondown>
@@ -166,9 +166,9 @@
<left>375</left>
<width>150</width>
<height>150</height>
<texturefocus colordiffuse="AA232323">Controls/background-diffuse.png</texturefocus>
<texturenofocus colordiffuse="00232323">Controls/background-diffuse.png</texturenofocus>
<alttexturefocus colordiffuse="FF232323">Controls/check_mark.png</alttexturefocus>
<texturefocus colordiffuse="AA232323">white.png</texturefocus>
<texturenofocus colordiffuse="00232323">white.png</texturenofocus>
<alttexturefocus colordiffuse="FF0082C2">Controls/check_mark.png</alttexturefocus>
<alttexturenofocus colordiffuse="FFFFFFFF">Controls/check_mark.png</alttexturenofocus>
<onup>10007</onup>
<ondown>10013</ondown>
@@ -180,9 +180,9 @@
<left>75</left>
<width>150</width>
<height>150</height>
<texturefocus colordiffuse="AA232323">Controls/background-diffuse.png</texturefocus>
<texturenofocus colordiffuse="00232323">Controls/background-diffuse.png</texturenofocus>
<alttexturefocus colordiffuse="FF232323">Controls/check_mark.png</alttexturefocus>
<texturefocus colordiffuse="AA232323">white.png</texturefocus>
<texturenofocus colordiffuse="00232323">white.png</texturenofocus>
<alttexturefocus colordiffuse="FF0082C2">Controls/check_mark.png</alttexturefocus>
<alttexturenofocus colordiffuse="FFFFFFFF">Controls/check_mark.png</alttexturenofocus>
<onup>10008</onup>
<ondown>10002</ondown>
@@ -194,9 +194,9 @@
<left>225</left>
<width>150</width>
<height>150</height>
<texturefocus colordiffuse="AA232323">Controls/background-diffuse.png</texturefocus>
<texturenofocus colordiffuse="00232323">Controls/background-diffuse.png</texturenofocus>
<alttexturefocus colordiffuse="FF232323">Controls/check_mark.png</alttexturefocus>
<texturefocus colordiffuse="AA232323">white.png</texturefocus>
<texturenofocus colordiffuse="00232323">white.png</texturenofocus>
<alttexturefocus colordiffuse="FF0082C2">Controls/check_mark.png</alttexturefocus>
<alttexturenofocus colordiffuse="FFFFFFFF">Controls/check_mark.png</alttexturenofocus>
<onup>10009</onup>
<ondown>10003</ondown>
@@ -208,9 +208,9 @@
<left>375</left>
<width>150</width>
<height>150</height>
<texturefocus colordiffuse="AA232323">Controls/background-diffuse.png</texturefocus>
<texturenofocus colordiffuse="00232323">Controls/background-diffuse.png</texturenofocus>
<alttexturefocus colordiffuse="FF232323">Controls/check_mark.png</alttexturefocus>
<texturefocus colordiffuse="AA232323">white.png</texturefocus>
<texturenofocus colordiffuse="00232323">white.png</texturenofocus>
<alttexturefocus colordiffuse="FF0082C2">Controls/check_mark.png</alttexturefocus>
<alttexturenofocus colordiffuse="FFFFFFFF">Controls/check_mark.png</alttexturenofocus>
<onup>10010</onup>
<ondown>10004</ondown>

View File

@@ -6,53 +6,45 @@
<controls>
<control type="group">
<animation type="WindowOpen" reversible="false">
<effect type="fade" start="0" end="100" time="600" />
<effect type="slide" start="115,0" end="0,0" time="600" />
<effect type="fade" start="0" end="100" time="300" />
</animation>
<animation type="WindowClose" reversible="false">
<effect type="fade" start="100" end="0" time="400" />
<effect type="slide" start="0,0" end="115,0" time="400" />
<effect type="fade" start="100" end="0" time="300" />
</animation>
<right>0</right>
<top>15</top>
<right>440</right>
<top>320</top>
<height>40</height>
<width>100%</width>
<width>400</width>
<control type="grouplist" id="20">
<orientation>horizontal</orientation>
<height>40</height>
<orientation>vertical</orientation>
<height>80</height>
<itemgap>0</itemgap>
<align>right</align>
<align>center</align>
<control type="button" id="3012">
<label>$INFO[Window.Property(title)]</label>
<label>$ADDON[plugin.video.kod 30045] $INFO[Window.Property(time)]</label>
<onclick>SendClick(3012)</onclick>
<height>40</height>
<width min="50">auto</width>
<width>400</width>
<font>font30_title</font>
<textoffsetx>20</textoffsetx>
<textcolor>80FFFFFF</textcolor>
<focusedcolor>FFFFFFFF</focusedcolor>
<selectedcolor>80FFFFFF</selectedcolor>
<shadowcolor>22000000</shadowcolor>
<textcolor>FFFFFFFF</textcolor>
<aligny>center</aligny>
<align>center</align>
<texturefocus border="10" colordiffuse="88232323">NextDialog/background-diffuse.png</texturefocus>
<texturenofocus border="10" colordiffuse="88232323">NextDialog/background-diffuse.png</texturenofocus>
<texturefocus border="10" colordiffuse="FF0082C2">white.png</texturefocus>
<texturenofocus border="10" colordiffuse="FF232323">white.png</texturenofocus>
<pulseonselect>no</pulseonselect>
</control>
<control type="button" id="3013">
<label>$ADDON[plugin.video.kod 60396]</label>
<label>$ADDON[plugin.video.kod 30046]</label>
<height>40</height>
<width min="50">auto</width>
<width>400</width>
<font>font30_title</font>
<textoffsetx>20</textoffsetx>
<textcolor>80FFFFFF</textcolor>
<focusedcolor>FFFFFFFF</focusedcolor>
<selectedcolor>80FFFFFF</selectedcolor>
<shadowcolor>22000000</shadowcolor>
<textcolor>FFFFFFFF</textcolor>
<aligny>center</aligny>
<align>center</align>
<texturefocus border="10" colordiffuse="88232323">NextDialog/background-diffuse.png</texturefocus>
<texturenofocus border="10" colordiffuse="88232323">NextDialog/background-diffuse.png</texturenofocus>
<texturefocus border="10" colordiffuse="FF0082C2">white.png</texturefocus>
<texturenofocus border="10" colordiffuse="FF232323">white.png</texturenofocus>
<pulseonselect>no</pulseonselect>
</control>
</control>

View File

@@ -12,8 +12,8 @@
<top>0</top>
<width>100%</width>
<height>100%</height>
<texturefocus colordiffuse="80232323">Shortcut/white.png</texturefocus>
<texturenofocus colordiffuse="80232323">Shortcut/white.png</texturenofocus>
<texturefocus colordiffuse="80232323">white.png</texturefocus>
<texturenofocus colordiffuse="80232323">white.png</texturenofocus>
<animation effect="fade" time="200">WindowOpen</animation>
<animation effect="fade" time="200">WindowClose</animation>
<onclick>Action(close)</onclick>
@@ -39,9 +39,9 @@
<top>219</top>
<width>1100</width>
<height>10</height>
<texturesliderbackground colordiffuse="FF232323">Shortcut/white.png</texturesliderbackground>
<texturesliderbar colordiffuse="FF1f1f1f">Shortcut/white.png</texturesliderbar>
<texturesliderbarfocus colordiffuse="FF0082C2">Shortcut/white.png</texturesliderbarfocus>
<texturesliderbackground colordiffuse="FF232323">white.png</texturesliderbackground>
<texturesliderbar colordiffuse="FF1f1f1f">white.png</texturesliderbar>
<texturesliderbarfocus colordiffuse="FF0082C2">white.png</texturesliderbarfocus>
<showonepage>false</showonepage>
<orientation>horizontal</orientation>
<ondown>32500</ondown>
@@ -50,7 +50,7 @@
<control type="image">
<width>1100</width>
<height>218</height>
<texture colordiffuse="FF232323">Shortcut/white.png</texture>
<texture colordiffuse="FF232323">white.png</texture>
</control>
<control type="list" id="32500">
<left>-130</left>
@@ -78,7 +78,7 @@
<top>1</top>
<width>220</width>
<height>218</height>
<texture colordiffuse="FF0082C2">Shortcut/white.png</texture>
<texture colordiffuse="FF0082C2">white.png</texture>
</control>
<control type="textbox">
<left>0</left>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.4 KiB

After

Width:  |  Height:  |  Size: 2.4 KiB

View File

Before

Width:  |  Height:  |  Size: 1.8 KiB

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 866 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 912 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 863 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 902 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.3 KiB

After

Width:  |  Height:  |  Size: 3.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

View File

Before

Width:  |  Height:  |  Size: 11 KiB

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

View File

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 167 B

View File

@@ -28,6 +28,7 @@ def start(itemlist, item):
:param item: item (the main item of the channel)
:return: try to auto-reproduce, in case of failure it returns the itemlist that it received in the beginning
'''
from inspect import stack
if item.global_search:
return itemlist
logger.info()
@@ -111,6 +112,7 @@ def start(itemlist, item):
# if the server and the quality are not in the favorites lists or the url is repeated, we discard the item
if item.server.lower() not in favorite_servers or item.quality.lower() not in favorite_quality or item.url in url_list_valid:
item.type_b = True
item.play_from = base_item.play_from
b_dict['videoitem']= item
autoplay_b.append(b_dict)
continue
@@ -122,6 +124,7 @@ def start(itemlist, item):
# if the server is not in the favorites list or the url is repeated, we discard the item
if item.server.lower() not in favorite_servers or item.url in url_list_valid:
item.type_b = True
item.play_from = base_item.play_from
b_dict['videoitem'] = item
autoplay_b.append(b_dict)
continue
@@ -132,6 +135,7 @@ def start(itemlist, item):
# if the quality is not in the favorites list or the url is repeated, we discard the item
if item.quality.lower() not in favorite_quality or item.url in url_list_valid:
item.type_b = True
item.play_from = base_item.play_from
b_dict['videoitem'] = item
autoplay_b.append(b_dict)
continue
@@ -140,13 +144,14 @@ def start(itemlist, item):
else: # Do not order
# if the url is repeated, we discard the item
item.play_from = base_item.play_from
if item.url in url_list_valid:
continue
# If the item reaches here we add it to the list of valid urls and to autoplay_list
url_list_valid.append(item.url)
item.plan_b=True
item.play_from = base_item.play_from
autoplay_elem['videoitem'] = item
autoplay_list.append(autoplay_elem)
@@ -225,13 +230,11 @@ def start(itemlist, item):
else: videoitem = resolved_item[0]
# If not directly reproduce and mark as seen
# Check if the item comes from the video library
try:
if base_item.contentChannel == 'videolibrary':
if base_item.contentChannel == 'videolibrary' or base_item.nfo:
# Mark as seen
from platformcode import xbmc_videolibrary
xbmc_videolibrary.mark_auto_as_watched(base_item)
# Fill the video with the data of the main item and play
play_item = base_item.clone(url=videoitem)
platformtools.play_video(play_item.url, autoplay=True)

View File

@@ -1,207 +0,0 @@
# -*- coding: utf-8 -*-
import xbmc, xbmcgui, os
from platformcode import config, platformtools
from time import time, sleep
from core import jsontools, filetools
from core.support import log, dbg
from core.item import Item
from platformcode.launcher import play_from_library
import sys
if sys.version_info[0] >= 3:
from concurrent import futures
else:
from concurrent_py2 import futures
next_dialogs = ['NextDialog.xml', 'NextDialogExtended.xml', 'NextDialogCompact.xml']
next_ep_type = config.get_setting('next_ep_type')
# compatibility with previous version
if type(next_ep_type) == bool:
ND = 'NextDialogCompact.xml' if config.get_setting('next_ep_type') else 'NextDialog.xml'
else:
ND = next_dialogs[next_ep_type]
def check(item):
return True if config.get_setting('next_ep') > 0 and item.contentType != 'movie' else False
def return_item(item):
log()
with futures.ThreadPoolExecutor() as executor:
future = executor.submit(next_ep, item)
item = future.result()
return item
def run(item):
log()
with futures.ThreadPoolExecutor() as executor:
future = executor.submit(next_ep, item)
item = future.result()
if item.next_ep:
return play_from_library(item)
def videolibrary(item):
from threading import Thread
item.videolibrary = True
Thread(target=next_ep, args=[item]).start()
def next_ep(item):
log()
condition = config.get_setting('next_ep')
item.next_ep = False
item.show_server = True
VL = True if item.videolibrary else False
time_over = False
time_limit = time() + 30
time_setting = config.get_setting('next_ep_seconds')
TimeFromEnd = time_setting
# wait until the video plays
while not platformtools.is_playing() and time() < time_limit:
sleep(1)
while platformtools.is_playing() and not time_over:
try:
Total = xbmc.Player().getTotalTime()
Actual = xbmc.Player().getTime()
Difference = Total - Actual
if Total > TimeFromEnd >= Difference:
time_over = True
except:
break
if time_over:
if condition == 1: # hide server afther x second
item.show_server = False
elif condition == 2: # play next file if exist
# check if next file exist
current_filename = filetools.basename(item.strm_path)
base_path = filetools.basename(filetools.dirname(item.strm_path))
path = filetools.join(config.get_videolibrary_path(), config.get_setting("folder_tvshows"),base_path)
fileList = []
for file in filetools.listdir(path):
if file.endswith('.strm'):
fileList.append(file)
fileList.sort()
nextIndex = fileList.index(current_filename) + 1
if nextIndex == 0 or nextIndex == len(fileList):
next_file = None
else:
next_file = fileList[nextIndex]
log('Next File:', next_file)
# start next episode window afther x time
if next_file:
season_ep = next_file.split('.')[0]
season = season_ep.split('x')[0]
episode = season_ep.split('x')[1]
next_ep = '%sx%s' % (season, episode)
item = Item(
action= 'play_from_library',
channel= 'videolibrary',
contentEpisodeNumber= episode,
contentSeason= season,
contentTitle= next_ep,
contentType= 'episode',
infoLabels= {'episode': episode, 'mediatype': 'episode', 'season': season, 'title': next_ep},
strm_path= os.sep + filetools.join(base_path, next_file))
global INFO
INFO = filetools.join(path, next_file.replace("strm", "nfo"))
log('Next Info:',INFO)
nextDialog = NextDialog(ND, config.get_runtime_path())
nextDialog.show()
while platformtools.is_playing() and not nextDialog.is_still_watching():
xbmc.sleep(100)
pass
nextDialog.close()
log('Next Episode:', nextDialog.stillwatching)
if nextDialog.stillwatching or nextDialog.continuewatching:
item.next_ep = True
xbmc.Player().stop()
if VL:
sleep(1)
xbmc.executebuiltin('Action(Back)')
sleep(0.5)
return play_from_library(item)
else:
item.show_server = False
if VL:
sleep(1)
xbmc.executebuiltin('Action(Back)')
sleep(0.5)
return None
return item
class NextDialog(xbmcgui.WindowXMLDialog):
item = None
cancel = False
stillwatching = False
continuewatching = True
def __init__(self, *args, **kwargs):
log()
self.action_exitkeys_id = [xbmcgui.ACTION_STOP, xbmcgui.ACTION_BACKSPACE, xbmcgui.ACTION_PREVIOUS_MENU, xbmcgui.ACTION_NAV_BACK]
self.progress_control = None
# set info
f = filetools.file_open(INFO, 'r')
full_info = f.read().split('\n')
full_info = full_info[1:]
f.close()
full_info = "".join(full_info)
info = jsontools.load(full_info)
info = info["infoLabels"]
self.setProperty("title", info["tvshowtitle"])
self.setProperty("ep_title", "%dx%02d - %s" % (info["season"], info["episode"], info["title"]))
if "episodio_imagen" in info:
img = info["episodio_imagen"]
else:
img = filetools.join(config.get_runtime_path(), "resources", "noimage.png")
self.setProperty("next_img", img)
def set_still_watching(self, stillwatching):
self.stillwatching = stillwatching
def set_continue_watching(self, continuewatching):
self.continuewatching = continuewatching
def is_still_watching(self):
return self.stillwatching
def onFocus(self, controlId):
pass
def doAction(self):
pass
def closeDialog(self):
self.close()
def onClick(self, controlId):
if controlId == 3012: # Still watching
self.set_still_watching(True)
self.set_continue_watching(False)
self.close()
elif controlId == 3013: # Cancel
self.set_continue_watching(False)
self.close()
def onAction(self, action):
log()
if action in self.action_exitkeys_id:
self.set_continue_watching(False)
self.close()

View File

@@ -582,6 +582,7 @@ def findvideos(item):
# We run find_videos, from the channel or common
item_json.contentChannel = 'videolibrary'
item_json.play_from = item.play_from
if hasattr(channel, 'findvideos'):
from core import servertools
if item_json.videolibray_emergency_urls:
@@ -629,10 +630,7 @@ def findvideos(item):
if autoplay.play_multi_channel(item, itemlist): # hideserver
return []
from inspect import stack
from specials import nextep
if nextep.check(item) and stack()[1][3] == 'run':
nextep.videolibrary(item)
add_download_items(item, itemlist)
return itemlist