mirror of
https://github.com/beetbox/beets.git
synced 2025-12-24 17:43:52 +01:00
Fix Media Headers on Import
This commit is contained in:
parent
3548e35360
commit
11932eb732
2 changed files with 10 additions and 6 deletions
|
|
@ -595,8 +595,12 @@ def album_info(release: Dict) -> beets.autotag.hooks.AlbumInfo:
|
|||
|
||||
# Media (format).
|
||||
if release["medium-list"]:
|
||||
first_medium = release["medium-list"][0]
|
||||
info.media = first_medium.get("format")
|
||||
# If all media are the same, use that medium name
|
||||
if len(set([x.get("format") for x in release["medium-list"]])) == 1:
|
||||
info.media = release["medium-list"][0].get("format")
|
||||
# Otherwise, let's just call it "Media"
|
||||
else:
|
||||
info.media = "Media"
|
||||
|
||||
if config["musicbrainz"]["genres"]:
|
||||
sources = [
|
||||
|
|
|
|||
|
|
@ -453,14 +453,14 @@ class ChangeRepresentation(object):
|
|||
|
||||
def make_medium_info_line(self, track_info):
|
||||
"""Construct a line with the current medium's info."""
|
||||
media = self.match.info.media or "Media"
|
||||
track_media = track_info.get("media", "Media")
|
||||
# Build output string.
|
||||
if self.match.info.mediums > 1 and track_info.disctitle:
|
||||
return f"* {media} {track_info.medium}: {track_info.disctitle}"
|
||||
return f"* {track_media} {track_info.medium}: {track_info.disctitle}"
|
||||
elif self.match.info.mediums > 1:
|
||||
return f"* {media} {track_info.medium}"
|
||||
return f"* {track_media} {track_info.medium}"
|
||||
elif track_info.disctitle:
|
||||
return f"* {media}: {track_info.disctitle}"
|
||||
return f"* {track_media}: {track_info.disctitle}"
|
||||
else:
|
||||
return ""
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue