feat(tracks): add edition tags to output filenames
Extend track.edition to support a list of tags (e.g., ["IMAX", "3D"]) that are inserted into the output filename before the resolution.
This commit is contained in:
@@ -151,7 +151,7 @@ class Audio(Track):
|
||||
),
|
||||
f"{self.bitrate // 1000} kb/s" if self.bitrate else None,
|
||||
self.get_track_name(),
|
||||
self.edition,
|
||||
", ".join(self.edition) if self.edition else None,
|
||||
],
|
||||
)
|
||||
)
|
||||
|
||||
@@ -66,8 +66,8 @@ class Track:
|
||||
raise TypeError(f"Expected name to be a {str}, not {type(name)}")
|
||||
if not isinstance(id_, (str, type(None))):
|
||||
raise TypeError(f"Expected id_ to be a {str}, not {type(id_)}")
|
||||
if not isinstance(edition, (str, type(None))):
|
||||
raise TypeError(f"Expected edition to be a {str}, not {type(edition)}")
|
||||
if not isinstance(edition, (str, list, type(None))):
|
||||
raise TypeError(f"Expected edition to be a {str}, {list}, or None, not {type(edition)}")
|
||||
if not isinstance(downloader, (Callable, type(None))):
|
||||
raise TypeError(f"Expected downloader to be a {Callable}, not {type(downloader)}")
|
||||
if not isinstance(downloader_args, (dict, type(None))):
|
||||
@@ -103,7 +103,7 @@ class Track:
|
||||
self.needs_repack = needs_repack
|
||||
self.name = name
|
||||
self.drm = drm
|
||||
self.edition: str = edition
|
||||
self.edition: list[str] = [edition] if isinstance(edition, str) else (edition or [])
|
||||
self.downloader = downloader
|
||||
self.downloader_args = downloader_args
|
||||
self.from_file = from_file
|
||||
|
||||
@@ -291,7 +291,7 @@ class Video(Track):
|
||||
],
|
||||
)
|
||||
),
|
||||
self.edition,
|
||||
", ".join(self.edition) if self.edition else None,
|
||||
],
|
||||
)
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user