mirror of
https://github.com/nathom/streamrip.git
synced 2025-05-15 07:34:48 -04:00
Add id
key in FOLDER_FORMAT #150
This commit is contained in:
parent
acec36801a
commit
e49df1e719
4 changed files with 5 additions and 2 deletions
|
@ -144,7 +144,7 @@ add_singles_to_folder = false
|
|||
# "container", and "albumcomposer"
|
||||
folder_format = "{albumartist} - {title} ({year}) [{container}] [{bit_depth}B-{sampling_rate}kHz]"
|
||||
# Available keys: "tracknumber", "artist", "albumartist", "composer", "title",
|
||||
# and "albumcomposer"
|
||||
# "id", and "albumcomposer"
|
||||
track_format = "{tracknumber}. {artist} - {title}"
|
||||
# Only allow printable ASCII characters in filenames.
|
||||
restrict_characters = false
|
||||
|
|
|
@ -136,6 +136,7 @@ ALBUM_KEYS = (
|
|||
"sampling_rate",
|
||||
"container",
|
||||
"albumcomposer",
|
||||
"id",
|
||||
)
|
||||
# TODO: rename these to DEFAULT_FOLDER_FORMAT etc
|
||||
FOLDER_FORMAT = "{albumartist} - {title} ({year}) [{container}] [{bit_depth}B-{sampling_rate}kHz]"
|
||||
|
|
|
@ -515,7 +515,6 @@ class Track(Media):
|
|||
a dict with the keys allowed in formatter strings, and their values in
|
||||
the TrackMetadata object.
|
||||
"""
|
||||
print(f"{restrict=}")
|
||||
formatter = self.meta.get_formatter(max_quality=self.quality)
|
||||
logger.debug("Track meta formatter %s", formatter)
|
||||
filename = clean_format(self.file_format, formatter, restrict=restrict)
|
||||
|
|
|
@ -167,6 +167,7 @@ class TrackMetadata:
|
|||
self.sampling_rate = resp.get("maximum_sampling_rate")
|
||||
self.quality = get_quality_id(self.bit_depth, self.sampling_rate)
|
||||
self.booklets = resp.get("goodies")
|
||||
self.id = resp.get("id")
|
||||
|
||||
if self.sampling_rate is not None:
|
||||
self.sampling_rate *= 1000
|
||||
|
@ -188,6 +189,7 @@ class TrackMetadata:
|
|||
# 80, 160, 320, 640, 1280
|
||||
self.cover_urls = get_cover_urls(resp, self.__source)
|
||||
self.streamable = resp.get("allowStreaming", False)
|
||||
self.id = resp.get("id")
|
||||
|
||||
if q := resp.get(
|
||||
"audioQuality"
|
||||
|
@ -220,6 +222,7 @@ class TrackMetadata:
|
|||
|
||||
self.cover_urls = get_cover_urls(resp, self.__source)
|
||||
self.streamable = True
|
||||
self.id = resp.get("id")
|
||||
|
||||
elif self.__source == "soundcloud":
|
||||
raise NotImplementedError
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue