Commit 8324c574 authored by echel0n's avatar echel0n

Added new release mapping %SY to allow appending the show year to episodes.

Added new show option to append show year to show folder if needed.
Added check for existing show year in show name, if found, do not append show year.
parent 954c6346
# Changelog
- * 7be7535 - 2019-02-23: Release v9.4.68
- * 879d546 - 2019-02-23: Added new release mapping %SY to allow appending the show year to episodes. Added new show option to append show year to show folder if needed. Added check for existing show year in show name, if found, do not append show year.
- * c3441ed - 2019-02-23: Release v9.4.68
- * 3f6df12 - 2019-02-23: Release v9.4.67
- * 83d1b88 - 2019-02-23: Moved RSS cache updates to separate background task that executes every 15 minutes. Parsed search results no longer grab their show id's from TheTVDB or Trackt since we only care about shows existing in library. Search results returned for shows not existing in library are discarded.
- * 9c78d0b - 2019-02-23: Release v9.4.66
......
......@@ -25,6 +25,7 @@ class Show(object):
self.genre = "Comedy"
self.indexerid = 00001
self.air_by_date = 0
self.startyear = 2011
self.sports = 0
self.anime = 0
self.scene = 0
......
......@@ -1120,6 +1120,7 @@ class TVEpisode(object):
'%SQN': Quality.sceneQualityStrings[epQual] + encoder,
'%SQ.N': dot(Quality.sceneQualityStrings[epQual] + encoder),
'%SQ_N': us(Quality.sceneQualityStrings[epQual] + encoder),
'%SY': str(self.show.startyear),
'%S': str(self.season),
'%0S': '%02d' % self.season,
'%E': str(self.episode),
......@@ -1223,7 +1224,7 @@ class TVEpisode(object):
season_ep_regex = r'''
(?P<pre_sep>[ _.-]*)
((?:s(?:eason|eries)?\s*)?%0?S(?![._]?N))
((?:s(?:eason|eries)?\s*)?%0?S(?![._]?N|Y))
(.*?)
(%0?E(?![._]?N))
(?P<post_sep>[ _.-]*)
......@@ -1273,8 +1274,7 @@ class TVEpisode(object):
# for limited extend we only append the last ep
if multi in (NAMING_LIMITED_EXTEND, NAMING_LIMITED_EXTEND_E_PREFIXED) and other_ep != \
self.relatedEps[
-1]:
self.relatedEps[-1]:
continue
elif multi == NAMING_DUPLICATE:
......@@ -1300,8 +1300,7 @@ class TVEpisode(object):
if self.season != 0: # dont set absolute numbers if we are on specials !
if anime_type == 1: # this crazy person wants both ! (note: +=)
ep_string += sep + "%(#)03d" % {
"#": curAbsolute_number}
ep_string += sep + "%(#)03d" % {"#": curAbsolute_number}
elif anime_type == 2: # total anime freak only need the absolute number ! (note: =)
ep_string = "%(#)03d" % {"#": curAbsolute_number}
......
This diff is collapsed.
......@@ -2612,7 +2612,7 @@ class HomeAddShows(Home):
quality_preset=None, anyQualities=None, bestQualities=None, flatten_folders=None, subtitles=None,
subtitles_sr_metadata=None, fullShowPath=None, other_shows=None, skipShow=None, providedIndexer=None,
anime=None, scene=None, blacklist=None, whitelist=None, defaultStatusAfter=None,
skip_downloaded=None, providedName=None):
skip_downloaded=None, providedName=None, add_show_year=None):
"""
Receive tvdb id, dir, and other options and create a show from them. If extra show dirs are
provided then it forwards back to newShow, if not it goes to /home.
......@@ -2672,6 +2672,8 @@ class HomeAddShows(Home):
show_dir = os.path.normpath(fullShowPath)
else:
show_dir = os.path.join(rootDir, sanitizeFileName(show_name))
if add_show_year and not re.match(r'.*\(\d+\)$', show_dir):
show_dir = "{} ({})".format(show_dir, re.search(r'\d{4}', series_pieces[5]).group(0))
# blanket policy - if the dir exists you should have used "add existing show" numbnuts
if os.path.isdir(show_dir) and not fullShowPath:
......
......@@ -54,7 +54,7 @@
</div>
<div class="row field-pair">
<div class="col-lg-3 col-md-4 col-sm-5">
<label class="component-title">${_('Skip downloaded')}</label>
<label class="component-title">${_('Skip Downloaded')}</label>
</div>
<div class="col-lg-9 col-md-8 col-sm-7 component-desc">
<label>
......@@ -63,6 +63,17 @@
</label>
</div>
</div>
<div class="row field-pair">
<div class="col-lg-3 col-md-4 col-sm-5">
<label class="component-title">${_('Append Show Year to Show Folder')}</label>
</div>
<div class="col-lg-9 col-md-8 col-sm-7 component-desc">
<label>
<input type="checkbox" class="toggle color-primary is-material" name="add_show_year"
id="add_show_year" />
</label>
</div>
</div>
<div class="row field-pair">
<div class="col-lg-3 col-md-4 col-sm-5">
<label class="component-title">${_('Status for previously aired episodes')}</label>
......
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