feat: real mutagen tagger and MusicBrainz tracklist
This commit is contained in:
@@ -47,6 +47,7 @@ class MusicBrainzResolver:
|
||||
|
||||
track_count = None
|
||||
total_duration_s = None
|
||||
titles: tuple[str, ...] = ()
|
||||
rgid = rg.get("id")
|
||||
if rgid:
|
||||
rgfull = musicbrainzngs.get_release_group_by_id(rgid, includes=["releases"])
|
||||
@@ -62,6 +63,7 @@ class MusicBrainzResolver:
|
||||
track_count = len(tracks)
|
||||
total_ms = sum(int((t.get("recording") or {}).get("length") or 0) for t in tracks)
|
||||
total_duration_s = total_ms // 1000 if total_ms else None
|
||||
titles = tuple((t.get("recording") or {}).get("title", "") for t in tracks)
|
||||
|
||||
return MBTarget(
|
||||
artist=canonical_artist,
|
||||
@@ -69,4 +71,5 @@ class MusicBrainzResolver:
|
||||
track_count=track_count,
|
||||
total_duration_s=total_duration_s,
|
||||
year=year,
|
||||
tracklist=titles,
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user