Commit 8b0251f6 authored by echel0n's avatar echel0n
Browse files

Merge branch 'release/9.4.43'

parents a7125d3e 5882a999
This diff is collapsed.
...@@ -371,6 +371,7 @@ def findCertainShow(indexerid, return_show_object=True): ...@@ -371,6 +371,7 @@ def findCertainShow(indexerid, return_show_object=True):
""" """
Find a show by indexer ID in the show list Find a show by indexer ID in the show list
:param return_show_object: returns a show object if True
:param showList: List of shows to search in (needle) :param showList: List of shows to search in (needle)
:param indexerid: Show to look for :param indexerid: Show to look for
:return: result list :return: result list
...@@ -1857,3 +1858,7 @@ def episode_num(season=None, episode=None, **kwargs): ...@@ -1857,3 +1858,7 @@ def episode_num(season=None, episode=None, **kwargs):
elif numbering == 'absolute': elif numbering == 'absolute':
if not (season and episode) and (season or episode): if not (season and episode) and (season or episode):
return '{0:0>3}'.format(season or episode) return '{0:0>3}'.format(season or episode)
def touch_file(file):
io.open(file, 'a').close()
...@@ -482,7 +482,8 @@ def already_postprocessed(dirName, videofile, force, result): ...@@ -482,7 +482,8 @@ def already_postprocessed(dirName, videofile, force, result):
if h['season'] == e['season'] and h['episode'] == e['episode'] if h['season'] == e['season'] and h['episode'] == e['episode']
and e['status'] in Quality.DOWNLOADED): and e['status'] in Quality.DOWNLOADED):
# If we find a showid, a season number, and one or more episode numbers then we need to use those in the query # If we find a showid, a season number, and one or more episode numbers then we need to use those in the
# query
if parse_result and (parse_result.indexerid and if parse_result and (parse_result.indexerid and
parse_result.episode_numbers and parse_result.episode_numbers and
parse_result.season_number): parse_result.season_number):
...@@ -493,6 +494,10 @@ def already_postprocessed(dirName, videofile, force, result): ...@@ -493,6 +494,10 @@ def already_postprocessed(dirName, videofile, force, result):
else: else:
return True return True
# Checks for processed file marker
if os.path.isfile(os.path.join(dirName, videofile + '.sr_processed')):
return True
return False return False
......
...@@ -33,7 +33,7 @@ from sickrage.core.exceptions import EpisodeNotFoundException, EpisodePostProces ...@@ -33,7 +33,7 @@ from sickrage.core.exceptions import EpisodeNotFoundException, EpisodePostProces
from sickrage.core.helpers import findCertainShow, show_names, replaceExtension, makeDir, \ from sickrage.core.helpers import findCertainShow, show_names, replaceExtension, makeDir, \
chmod_as_parent, move_file, copy_file, hardlink_file, move_and_symlink_file, remove_non_release_groups, \ chmod_as_parent, move_file, copy_file, hardlink_file, move_and_symlink_file, remove_non_release_groups, \
remove_extension, \ remove_extension, \
isFileLocked, verify_freespace, delete_empty_folders, make_dirs, symlink, is_rar_file, glob_escape isFileLocked, verify_freespace, delete_empty_folders, make_dirs, symlink, is_rar_file, glob_escape, touch_file
from sickrage.core.nameparser import InvalidNameException, InvalidShowException, \ from sickrage.core.nameparser import InvalidNameException, InvalidShowException, \
NameParser NameParser
from sickrage.core.tv.show.history import FailedHistory, History # memory intensive from sickrage.core.tv.show.history import FailedHistory, History # memory intensive
...@@ -51,7 +51,7 @@ class PostProcessor(object): ...@@ -51,7 +51,7 @@ class PostProcessor(object):
EXISTS_SMALLER = 3 EXISTS_SMALLER = 3
DOESNT_EXIST = 4 DOESNT_EXIST = 4
IGNORED_FILESTRINGS = [".AppleDouble", ".DS_Store"] IGNORED_FILESTRINGS = [".AppleDouble", ".DS_Store", ".sr_processed"]
PROCESS_METHOD_COPY = "copy" PROCESS_METHOD_COPY = "copy"
PROCESS_METHOD_MOVE = "move" PROCESS_METHOD_MOVE = "move"
...@@ -930,6 +930,9 @@ class PostProcessor(object): ...@@ -930,6 +930,9 @@ class PostProcessor(object):
return False return False
def _add_processed_marker_file(self, file_path):
touch_file(file_path + '.sr_processed')
@property @property
def process(self): def process(self):
""" """
...@@ -1135,6 +1138,7 @@ class PostProcessor(object): ...@@ -1135,6 +1138,7 @@ class PostProcessor(object):
raise EpisodePostProcessingFailedException("File is locked for reading") raise EpisodePostProcessingFailedException("File is locked for reading")
self._copy(self.file_path, dest_path, new_base_name, sickrage.app.config.move_associated_files, self._copy(self.file_path, dest_path, new_base_name, sickrage.app.config.move_associated_files,
sickrage.app.config.use_subtitles and ep_obj.show.subtitles) sickrage.app.config.use_subtitles and ep_obj.show.subtitles)
self._add_processed_marker_file(self.file_path)
elif self.process_method == self.PROCESS_METHOD_MOVE: elif self.process_method == self.PROCESS_METHOD_MOVE:
if isFileLocked(self.file_path, True): if isFileLocked(self.file_path, True):
raise EpisodePostProcessingFailedException("File is locked for reading/writing") raise EpisodePostProcessingFailedException("File is locked for reading/writing")
...@@ -1143,15 +1147,18 @@ class PostProcessor(object): ...@@ -1143,15 +1147,18 @@ class PostProcessor(object):
elif self.process_method == self.PROCESS_METHOD_HARDLINK: elif self.process_method == self.PROCESS_METHOD_HARDLINK:
self._hardlink(self.file_path, dest_path, new_base_name, sickrage.app.config.move_associated_files, self._hardlink(self.file_path, dest_path, new_base_name, sickrage.app.config.move_associated_files,
sickrage.app.config.use_subtitles and ep_obj.show.subtitles) sickrage.app.config.use_subtitles and ep_obj.show.subtitles)
self._add_processed_marker_file(self.file_path)
elif self.process_method == self.PROCESS_METHOD_SYMLINK: elif self.process_method == self.PROCESS_METHOD_SYMLINK:
if isFileLocked(self.file_path, True): if isFileLocked(self.file_path, True):
raise EpisodePostProcessingFailedException("File is locked for reading/writing") raise EpisodePostProcessingFailedException("File is locked for reading/writing")
self._moveAndSymlink(self.file_path, dest_path, new_base_name, self._moveAndSymlink(self.file_path, dest_path, new_base_name,
sickrage.app.config.move_associated_files, sickrage.app.config.move_associated_files,
sickrage.app.config.use_subtitles and ep_obj.show.subtitles) sickrage.app.config.use_subtitles and ep_obj.show.subtitles)
self._add_processed_marker_file(self.file_path)
elif self.process_method == self.PROCESS_METHOD_SYMLINK_REVERSED: elif self.process_method == self.PROCESS_METHOD_SYMLINK_REVERSED:
self._symlink(self.file_path, dest_path, new_base_name, sickrage.app.config.move_associated_files, self._symlink(self.file_path, dest_path, new_base_name, sickrage.app.config.move_associated_files,
sickrage.app.config.use_subtitles and ep_obj.show.subtitles) sickrage.app.config.use_subtitles and ep_obj.show.subtitles)
self._add_processed_marker_file(self.file_path)
else: else:
sickrage.app.log.error("Unknown process method: " + str(self.process_method)) sickrage.app.log.error("Unknown process method: " + str(self.process_method))
raise EpisodePostProcessingFailedException("Unable to move the files to their new home") raise EpisodePostProcessingFailedException("Unable to move the files to their new home")
......
...@@ -816,6 +816,8 @@ class TVEpisode(object): ...@@ -816,6 +816,8 @@ class TVEpisode(object):
return self._format_pattern('%SN - %AB - %EN') return self._format_pattern('%SN - %AB - %EN')
elif self.show.air_by_date: elif self.show.air_by_date:
return self._format_pattern('%SN - %AD - %EN') return self._format_pattern('%SN - %AD - %EN')
elif self.show.scene:
return self._format_pattern('%SN - %XSx%0XE - %EN')
return self._format_pattern('%SN - %Sx%0E - %EN') return self._format_pattern('%SN - %Sx%0E - %EN')
......
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -564,8 +564,19 @@ class WebRoot(WebHandler): ...@@ -564,8 +564,19 @@ class WebRoot(WebHandler):
return self.redirect('/logout/') return self.redirect('/logout/')
def quicksearch_json(self, term): def quicksearch_json(self, term):
return json_encode( shows = sickrage.app.quicksearch_cache.get_shows(term)
sickrage.app.quicksearch_cache.get_shows(term) + sickrage.app.quicksearch_cache.get_episodes(term)) episodes = sickrage.app.quicksearch_cache.get_episodes(term)
if not len(shows):
shows = [{
'category': 'shows',
'showid': '',
'name': term,
'img': '/images/poster-thumb.png',
'seasons': 0,
}]
return json_encode(shows + episodes)
@Route('/browser(/?.*)') @Route('/browser(/?.*)')
...@@ -1387,7 +1398,7 @@ class Home(WebHandler): ...@@ -1387,7 +1398,7 @@ class Home(WebHandler):
else: else:
do_update = True do_update = True
if scene == showObj.scene and anime == showObj.anime: if scene == showObj.scene or anime == showObj.anime:
do_update_scene_numbering = False do_update_scene_numbering = False
else: else:
do_update_scene_numbering = True do_update_scene_numbering = True
...@@ -1504,7 +1515,7 @@ class Home(WebHandler): ...@@ -1504,7 +1515,7 @@ class Home(WebHandler):
if do_update_scene_numbering: if do_update_scene_numbering:
try: try:
xem_refresh(showObj.indexerid, showObj.indexer) xem_refresh(showObj.indexerid, showObj.indexer, True)
time.sleep(cpu_presets[sickrage.app.config.cpu_preset]) time.sleep(cpu_presets[sickrage.app.config.cpu_preset])
except CantUpdateShowException as e: except CantUpdateShowException as e:
warnings.append(_("Unable to force an update on scene numbering of the show.")) warnings.append(_("Unable to force an update on scene numbering of the show."))
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment