style: apply ruff linting fixes across codebase

This commit is contained in:
imSp4rky
2026-04-08 22:09:19 -06:00
parent 725edd59e0
commit 50d2b127ec
19 changed files with 138 additions and 127 deletions
+11 -11
View File
@@ -103,33 +103,33 @@ class Episode(Title):
if config.folder_template:
formatter = TemplateFormatter(config.folder_template)
context = self._build_template_context(media_info, show_service)
context['season'] = f"S{self.season:02}"
context["season"] = f"S{self.season:02}"
folder_name = formatter.format(context)
separators = re.sub(r'\{[^}]*\}', '', config.folder_template)
separators = re.sub(r"\{[^}]*\}", "", config.folder_template)
spacer = "." if "." in separators and " " not in separators else " "
return sanitize_filename(folder_name, spacer)
series_template = config.output_template.get("series")
if series_template:
derived_template = series_template
derived_template = re.sub(r'\{episode\}', '', derived_template)
derived_template = re.sub(r'\{episode_name\?\}', '', derived_template)
derived_template = re.sub(r'\{episode_name\}', '', derived_template)
derived_template = re.sub(r'\{season_episode\}', '{season}', derived_template)
derived_template = re.sub(r"\{episode\}", "", derived_template)
derived_template = re.sub(r"\{episode_name\?\}", "", derived_template)
derived_template = re.sub(r"\{episode_name\}", "", derived_template)
derived_template = re.sub(r"\{season_episode\}", "{season}", derived_template)
derived_template = re.sub(r'\.{2,}', '.', derived_template)
derived_template = re.sub(r'\s{2,}', ' ', derived_template)
derived_template = re.sub(r'^[\.\s]+|[\.\s]+$', '', derived_template)
derived_template = re.sub(r"\.{2,}", ".", derived_template)
derived_template = re.sub(r"\s{2,}", " ", derived_template)
derived_template = re.sub(r"^[\.\s]+|[\.\s]+$", "", derived_template)
formatter = TemplateFormatter(derived_template)
context = self._build_template_context(media_info, show_service)
context['season'] = f"S{self.season:02}"
context["season"] = f"S{self.season:02}"
folder_name = formatter.format(context)
separators = re.sub(r'\{[^}]*\}', '', derived_template)
separators = re.sub(r"\{[^}]*\}", "", derived_template)
spacer = "." if "." in separators and " " not in separators else " "
return sanitize_filename(folder_name, spacer)
else:
+1 -1
View File
@@ -65,7 +65,7 @@ class Movie(Title):
context = self._build_template_context(media_info, show_service)
folder_name = formatter.format(context)
separators = re.sub(r'\{[^}]*\}', '', config.folder_template)
separators = re.sub(r"\{[^}]*\}", "", config.folder_template)
spacer = "." if "." in separators and " " not in separators else " "
return sanitize_filename(folder_name, spacer)
name = f"{self.name}"
+1 -1
View File
@@ -100,7 +100,7 @@ class Song(Title):
context = self._build_template_context(media_info, show_service)
folder_name = formatter.format(context)
separators = re.sub(r'\{[^}]*\}', '', config.folder_template)
separators = re.sub(r"\{[^}]*\}", "", config.folder_template)
spacer = "." if "." in separators and " " not in separators else " "
return sanitize_filename(folder_name, spacer)
name = f"{self.artist} - {self.album}"