Skip to content

albumartist_website: handle URLs that have ended #391

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 12, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions plugins/albumartist_website/albumartist_website.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
PLUGIN_AUTHOR = 'Sophist, Sambhav Kothari, Philipp Wolfer'
PLUGIN_DESCRIPTION = '''Add's the album artist(s) Official Homepage(s)
(if they are defined in the MusicBrainz database).'''
PLUGIN_VERSION = '1.1'
PLUGIN_VERSION = '1.2'
PLUGIN_API_VERSIONS = ["2.0", "2.1", "2.2"]
PLUGIN_LICENSE = "GPL-2.0"
PLUGIN_LICENSE_URL = "https://www.gnu.org/licenses/gpl-2.0.html"
Expand Down Expand Up @@ -128,8 +128,11 @@ def artist_process_metadata(self, artistId, response):
log.debug("%s: %r: Examining: %r", PLUGIN_NAME, artistId, relation)
if 'type' in relation.attribs and relation.type == 'official homepage':
if 'target' in relation.children and len(relation.target) > 0:
log.debug("%s: Adding artist url: %s", PLUGIN_NAME, relation.target[0].text)
urls.append(relation.target[0].text)
if not 'ended' in relation.children or relation.ended[0].text != 'true':
log.debug("%s: Adding artist url: %s", PLUGIN_NAME, relation.target[0].text)
urls.append(relation.target[0].text)
else:
log.debug("%s: Artist url has ended: %s", PLUGIN_NAME, relation.target[0].text)
else:
log.debug("%s: No url in relation: %r", PLUGIN_NAME, relation)

Expand Down