Skip to content
This repository was archived by the owner on Apr 26, 2024. It is now read-only.
This repository was archived by the owner on Apr 26, 2024. It is now read-only.

Fails if song metadata does not contain an "album" property #18

@Gadgetoid

Description

@Gadgetoid

In some cases a downloaded, single song (in this case, Dark all Day by GUNSHIP grabbed from BandCamp) may not have an "album" associated with it.

This causes a hard fail where it's assumed "album" exists, for example in brainz.py:

data = mus.search_releases(artist=song["artist"],
                           release=song["album"],
                           limit=1)

This can be fixed by using "title" in lieu of "album", and this seems to correctly fetch the album art too:

artist = song.get("artist")
title = song.get("title")
album = song.get("album", title)
data = mus.search_releases(artist=artist,
                           release=album,
                           limit=1)

I'm happy to do a PR to fix this, but can anyone think of instances where this might fail?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions