- Fix item.nfo e item.strm_path
- Fix vari - N.B. Ove possibile usare item.clone() al posto di Item()
This commit is contained in:
@@ -1039,40 +1039,11 @@ def resume_playback(item, return_played_time=False):
|
||||
|
||||
from core import videolibrarytools, filetools
|
||||
|
||||
# if nfo and strm_path not exist
|
||||
if not item.nfo:
|
||||
ID = item.infoLabels['IMDBNumber']
|
||||
if item.contentType == 'movie':
|
||||
ID = ID if ID else item.infoLabels['tmdb_id']
|
||||
vl = xbmc.translatePath(filetools.join(config.get_setting("videolibrarypath"), config.get_setting("folder_movies")))
|
||||
name = item.contentTitle if not config.get_setting('original_title_folder', 'videolibrary') else item.infoLabels['originaltitle']
|
||||
name = name if not config.get_setting('lowerize_title', 'videolibrary') else name.lower()
|
||||
path = filetools.validate_path('%s [%s]' % (name, ID))
|
||||
item.nfo = filetools.join(vl, path, path + '.nfo')
|
||||
if not item.strm_path: item.strm_path = filetools.join(path, item.contentTitle + '.strm')
|
||||
else:
|
||||
ID = ID if ID else 'tmdb_' + item.infoLabels['tmdb_id'] if config.get_setting('scraper_tvshows', 'videolibrary') == 0 else 'tvdb_' + item.infoLabels['tvdb_id']
|
||||
vl = xbmc.translatePath(filetools.join(config.get_setting("videolibrarypath"), config.get_setting("folder_tvshows")))
|
||||
name = item.contentSerieName if not config.get_setting('original_title_folder', 'videolibrary') else item.infoLabels['originaltitle']
|
||||
name = name if not config.get_setting('lowerize_title', 'videolibrary') else name.lower()
|
||||
path = filetools.validate_path('%s [%s]' % (name, ID))
|
||||
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')))
|
||||
nfo_path = item.strm_path.replace('strm','nfo')
|
||||
|
||||
if filetools.isfile(nfo_path):
|
||||
head_nfo, item_nfo = videolibrarytools.read_nfo(nfo_path)
|
||||
|
||||
@@ -57,7 +57,8 @@ def mark_auto_as_watched(item, nfo_path=None, head_nfo=None, item_nfo=None):
|
||||
break
|
||||
|
||||
# check for next Episode
|
||||
if next_episode and total_time > time_from_end >= difference:
|
||||
if next_episode and marked and time_from_end >= difference:
|
||||
# from core.support import dbg;dbg()
|
||||
nextdialog = NextDialog(ND, config.get_runtime_path())
|
||||
nextdialog.show()
|
||||
while platformtools.is_playing() and not nextdialog.is_exit():
|
||||
|
||||
Reference in New Issue
Block a user