mirror of
https://github.com/unshackle-dl/unshackle.git
synced 2026-11-27 11:25:08 +00:00
fix(titles): drop folder {year?} when it repeats the dated season label
Dated episodes turn the season folder into the air year, so a folder template's {year?} rendered the same year twice (Title.2025.2025).
This commit is contained in:
@@ -218,7 +218,8 @@ class Episode(Title):
|
||||
# all parts of an episode land in the same season folder
|
||||
context = self.build_template_context(media_info, show_service, include_part=False)
|
||||
context["season"] = self.folder_season()
|
||||
context["year"] = self.year or "" # folders keep the year
|
||||
# folders keep the year, unless the season label is already the air year
|
||||
context["year"] = "" if str(self.year) == context["season"] else self.year or ""
|
||||
spacer = detect_spacer(template) # one style for the whole path
|
||||
segments = [
|
||||
TemplateFormatter(seg, spacer).format(context)
|
||||
@@ -242,7 +243,8 @@ class Episode(Title):
|
||||
formatter = TemplateFormatter(derived_template)
|
||||
context = self.build_template_context(media_info, show_service, include_part=False)
|
||||
context["season"] = self.folder_season()
|
||||
context["year"] = self.year or "" # folders keep the year
|
||||
# folders keep the year, unless the season label is already the air year
|
||||
context["year"] = "" if str(self.year) == context["season"] else self.year or ""
|
||||
|
||||
folder_name = formatter.format(context)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user