mirror of
https://github.com/Dvorinka/swingmusic-extended.git
synced 2026-06-04 20:43:04 +00:00
handle discs in album page
This commit is contained in:
@@ -68,7 +68,7 @@ def get_album():
|
||||
album.count == 1
|
||||
and tracks[0].title == album.title
|
||||
and tracks[0].tracknumber == 1
|
||||
and tracks[0].disknumber == 1
|
||||
and tracks[0].discnumber == 1
|
||||
):
|
||||
album.is_single = True
|
||||
|
||||
|
||||
@@ -97,7 +97,7 @@ class CheckArtistImages:
|
||||
@staticmethod
|
||||
def check_if_exists(img_path: str):
|
||||
"""
|
||||
Checks if an image exists on disk.
|
||||
Checks if an image exists on c.
|
||||
"""
|
||||
|
||||
if os.path.exists(img_path):
|
||||
|
||||
@@ -147,7 +147,7 @@ def parse_track_number(tags):
|
||||
|
||||
def parse_disc_number(tags):
|
||||
"""
|
||||
Parses the disk number from an audio file.
|
||||
Parses the disc number from an audio file.
|
||||
"""
|
||||
try:
|
||||
disc_number = int(tags["discnumber"][0])
|
||||
@@ -183,7 +183,7 @@ def get_tags(fullpath: str) -> dict | None:
|
||||
"genre": parse_genre_tag(tags),
|
||||
"date": parse_date_tag(tags)[:4],
|
||||
"tracknumber": parse_track_number(tags),
|
||||
"disknumber": parse_disc_number(tags),
|
||||
"discnumber": parse_disc_number(tags),
|
||||
"copyright": parse_copyright(tags),
|
||||
"length": round(tags.info.length),
|
||||
"bitrate": round(int(tags.info.bitrate) / 1000),
|
||||
|
||||
@@ -25,7 +25,7 @@ class Track:
|
||||
genre: str
|
||||
bitrate: int
|
||||
tracknumber: int
|
||||
disknumber: int
|
||||
discnumber: int
|
||||
albumhash: str
|
||||
date: str
|
||||
image: str
|
||||
@@ -42,7 +42,7 @@ class Track:
|
||||
self.genre = tags["genre"]
|
||||
self.bitrate = int(tags["bitrate"])
|
||||
self.length = int(tags["length"])
|
||||
self.disknumber = int(tags["disknumber"])
|
||||
self.discnumber = int(tags["discnumber"])
|
||||
self.albumhash = tags["albumhash"]
|
||||
self.date = tags["date"]
|
||||
self.image = tags["albumhash"] + ".webp"
|
||||
|
||||
Reference in New Issue
Block a user