Commit 8b0251f6 authored by echel0n's avatar echel0n

Merge branch 'release/9.4.43'

parents a7125d3e 5882a999
Pipeline #322 passed with stage
in 4 minutes and 9 seconds
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -371,6 +371,7 @@ def findCertainShow(indexerid, return_show_object=True):
"""
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 indexerid: Show to look for
:return: result list
......@@ -1857,3 +1858,7 @@ def episode_num(season=None, episode=None, **kwargs):
elif numbering == 'absolute':
if not (season and episode) and (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):
if h['season'] == e['season'] and h['episode'] == e['episode']
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
parse_result.episode_numbers and
parse_result.season_number):
......@@ -493,6 +494,10 @@ def already_postprocessed(dirName, videofile, force, result):
else:
return True
# Checks for processed file marker
if os.path.isfile(os.path.join(dirName, videofile + '.sr_processed')):
return True
return False
......
......@@ -33,7 +33,7 @@ from sickrage.core.exceptions import EpisodeNotFoundException, EpisodePostProces
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, \
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, \
NameParser
from sickrage.core.tv.show.history import FailedHistory, History # memory intensive
......@@ -51,7 +51,7 @@ class PostProcessor(object):
EXISTS_SMALLER = 3
DOESNT_EXIST = 4
IGNORED_FILESTRINGS = [".AppleDouble", ".DS_Store"]
IGNORED_FILESTRINGS = [".AppleDouble", ".DS_Store", ".sr_processed"]
PROCESS_METHOD_COPY = "copy"
PROCESS_METHOD_MOVE = "move"
......@@ -930,6 +930,9 @@ class PostProcessor(object):
return False
def _add_processed_marker_file(self, file_path):
touch_file(file_path + '.sr_processed')
@property
def process(self):
"""
......@@ -1135,6 +1138,7 @@ class PostProcessor(object):
raise EpisodePostProcessingFailedException("File is locked for reading")
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)
self._add_processed_marker_file(self.file_path)
elif self.process_method == self.PROCESS_METHOD_MOVE:
if isFileLocked(self.file_path, True):
raise EpisodePostProcessingFailedException("File is locked for reading/writing")
......@@ -1143,15 +1147,18 @@ class PostProcessor(object):
elif self.process_method == self.PROCESS_METHOD_HARDLINK:
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)
self._add_processed_marker_file(self.file_path)
elif self.process_method == self.PROCESS_METHOD_SYMLINK:
if isFileLocked(self.file_path, True):
raise EpisodePostProcessingFailedException("File is locked for reading/writing")
self._moveAndSymlink(self.file_path, dest_path, new_base_name,
sickrage.app.config.move_associated_files,
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:
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)
self._add_processed_marker_file(self.file_path)
else:
sickrage.app.log.error("Unknown process method: " + str(self.process_method))
raise EpisodePostProcessingFailedException("Unable to move the files to their new home")
......
......@@ -816,6 +816,8 @@ class TVEpisode(object):
return self._format_pattern('%SN - %AB - %EN')
elif self.show.air_by_date:
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')
......
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):
return self.redirect('/logout/')
def quicksearch_json(self, term):
return json_encode(
sickrage.app.quicksearch_cache.get_shows(term) + sickrage.app.quicksearch_cache.get_episodes(term))
shows = sickrage.app.quicksearch_cache.get_shows(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(/?.*)')
......@@ -1387,7 +1398,7 @@ class Home(WebHandler):
else:
do_update = True
if scene == showObj.scene and anime == showObj.anime:
if scene == showObj.scene or anime == showObj.anime:
do_update_scene_numbering = False
else:
do_update_scene_numbering = True
......@@ -1504,7 +1515,7 @@ class Home(WebHandler):
if do_update_scene_numbering:
try:
xem_refresh(showObj.indexerid, showObj.indexer)
xem_refresh(showObj.indexerid, showObj.indexer, True)
time.sleep(cpu_presets[sickrage.app.config.cpu_preset])
except CantUpdateShowException as e:
warnings.append(_("Unable to force an update on scene numbering of the show."))
......
This diff is collapsed.
......@@ -177,7 +177,7 @@ class GenericProvider(object):
for show_name in allPossibleShowNames(episode.show, episode.scene_season):
episode_string = show_name + self.search_separator
episode_string_fallbacks = []
episode_string_fallback = None
if episode.show.air_by_date:
episode_string += str(episode.airdate).replace('-', ' ')
......@@ -193,8 +193,8 @@ class GenericProvider(object):
ep = episode.scene_episode
else:
ep = episode.scene_absolute_number
episode_string_fallbacks += [episode_string + '{episode:0>3}'.format(episode=ep)]
episode_string += '{episode:0>2}'.format(episode=ep)
episode_string_fallback = episode_string + '{episode:0>3}'.format(episode=ep)
else:
episode_string += sickrage.app.naming_ep_type[2] % {
'seasonnumber': episode.scene_season,
......@@ -203,12 +203,10 @@ class GenericProvider(object):
if add_string:
episode_string += self.search_separator + add_string
for i, episode_string_fallback in enumerate(episode_string_fallbacks):
episode_string_fallback += self.search_separator + add_string
episode_string_fallbacks[i] = episode_string_fallback
episode_string_fallback += self.search_separator + add_string
search_string['Episode'].append(episode_string.strip())
for episode_string_fallback in episode_string_fallbacks:
if episode_string_fallback:
search_string['Episode'].append(episode_string_fallback.strip())
return [search_string]
......
......@@ -31,12 +31,12 @@ from sickrage.providers import TorrentProvider
class Torrent9Provider(TorrentProvider):
def __init__(self):
super(Torrent9Provider, self).__init__('Torrent9', 'ww1.torrent9.ph', False)
super(Torrent9Provider, self).__init__('Torrent9', 'https://www.torrent9.ph', False)
self.urls.update({
'search': '{base_url}/search_torrent/'.format(**self.urls),
'rss': '{base_url}/torrents_series.html,trie-date-d'.format(**self.urls),
'download': '{base_url}get_torrent/%s.torrent'.format(**self.urls)
'download': '{base_url}/get_torrent/%s.torrent'.format(**self.urls)
})
self.minseed = None
......
9.4.41
\ No newline at end of file
9.4.43
\ No newline at end of file
......@@ -175,15 +175,28 @@ $(document).ready(function ($) {
});
if (item.category === 'shows') {
$a.attr({
href: `${SICKRAGE.srWebRoot}/home/displayShow?show=${item.showid}`,
class: 'btn btn-dark btn-block d-inline-block text-left'
});
if (item.showid) {
$a.attr({
href: `${SICKRAGE.srWebRoot}/home/displayShow?show=${item.showid}`,
class: 'btn btn-dark btn-block d-inline-block text-left'
});
} else {
$a.attr({
href: `${SICKRAGE.srWebRoot}/home/addShows/newShow?search_string=${item.name}`,
class: 'btn btn-dark btn-block d-inline-block text-left'
});
}
$li.append($a);
$li.find('a').append($('<div class="row"><div class="col-2"><div id="show-img"></div></div><div class="col-10"><div class="row"><strong id="show-name" class="text-white text-truncate"></strong></div><div class="row"><strong id="show-seasons" class="text-secondary"></strong></div></div></div>'));
$li.find('#show-img').append($img);
$li.find('#show-name').append(item.name);
if (item.showid) {
$li.find('#show-name').append(item.name);
} else {
$li.find('#show-name').append('Add new show: ' + item.name);
}
$li.find('#show-seasons').append(item.seasons + ' seasons');
} else {
$a.attr({
......
Markdown is supported
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