Skip to content
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

add plugin to set website from relations #341

Open
wants to merge 4 commits into
base: 2.0
Choose a base branch
from

Conversation

tobiasSarner
Copy link
Contributor

this do not attache existing artist website plugin and can used separate to it
it is add currently the url from album-artist, release and release-group

sarner-tobias added 2 commits November 3, 2022 23:13
this do not attache existing artist website plugin and can used separate
to it
it is add currently the url from album-artist, release and release-group
PLUGIN_NAME = 'Musicbrainz Relations Website'
PLUGIN_AUTHOR = 'Tobias Sarner'
PLUGIN_DESCRIPTION = '''Uses Musicbrainz relations to set website advanced.
-Album Artist Website- plugin, can used separate to set album artist(s) Official Homepage(s) and will not attached by this plugin
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am entirely unclear from this description what the relationship of this plugin is to my Album Artist Website plugin. But I wonder whether this functionality would be better served by adding it to the Album Artist Website plugin (renaming it Websites Metadata perhaps) rather than creating a new one.

website:release-group_1_https://www.discogs.com/master/2831825'''
PLUGIN_LICENSE = "GPL-2.0"
PLUGIN_LICENSE_URL = "https://www.gnu.org/licenses/gpl-2.0.txt"
PLUGIN_VERSION = "1.0.0"
Copy link
Contributor

@Sophist-UK Sophist-UK Nov 4, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If this is experimental, the version number should be 0.0.1.

WARNING: Experimental plugin. All guarantees voided by use.

Example: Taylor Swift
website:artist_1_official homepage https://www.taylorswift.com/
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. I am not sure that you can just suffix the existing website tag with :subtag and not screw up the existing usage of website without a suffix. From memory (which is old and may be wrong) Picard knows which tags are multi-value, and AFAIK website is not one of them.
  2. website is explicitly mapped to e.g. the ID3v2 WOAR tag which is explicitly for the Album Artist official webpage. The WOAS tag is defined in ID3v2 as holding the official web page for the Release, and Picard needs a definition of a metadata name for this and a mapping to ID3 and other tagging formats to defined how it is loaded and saved.
  3. Similarly there is a WXXX:subtag tag in ID3v2 to hold miscellaneous URLs that do not have explicit tags - so e.g. the Discord URL should be saved in WXXX:discord, and again a mapping from metadata to WXXX would be needed in Picard to support this. I don't have any issues with the idea of storing the Discord URL for use in players, but if we are going to support Discord we should probably also have a Discord-Release metadata variable which holds the discord release number and Discord-Release Group to store the Discord master release number. Discord URLs can then be generated from these if you double click on them in Picard.

So, what I am saying is that ideally there would need to be a Picard enhancement to support the metadata you want to hold and make sure it gets saved in the write tags for the various formats. If someone is going to do this, then a comprehensive review of ID3 tags and other formats and a full mapping of these to metadata names would be a great enhancement IMO.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Without further knowledge Picard would just save a TXXX:website:subtag, so that would not be a problem in general. Even though some tags use colons for special behavior (e.g. comment:description), there is nothing special per se for this notation.

But anyway, I totally agree with the points you make above. It would be better if support for WXXX (and in general more of the W*** webpage tags) would exist. As a first step having website:subtag mapped to WXXX:subtag sounds sensible. But we could also directly support let's say website:pay for WPAY (PICARD-1394) or so.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added PICARD-2587 as a start. Not yet sure if my suggestion is the best idea.

MUSICBRAINZ_HOST = "musicbrainz.org"
MUSICBRAINZ_PORT = 80

ratecontrol.set_minimum_delay((MUSICBRAINZ_HOST, MUSICBRAINZ_PORT), 50)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMO you absolutely should not override the ratecontrol in a plugin like this.

"fmt": "json",
"inc": "url-rels"
}
album.tagger.webservice.get(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When I wrote the Artist website plugin, the artist official website was not available in the standard release metadata (even with the extra relations enabled) so I wrote the plugin to make an additional webservice call. BUT, since it was likely that a user might be tagging multiple albums for the same artist, I spent a lot of time crafting a caching mechanism, so that you only made 1 call per artist for the lifetime of the Picard execution process. If you are going to duplicate the functionality to make such a webservice call, you probably ought to reuse the caching code I wrote.

album.tagger.webservice.get(
config.setting["server_host"],
config.setting["server_port"],
"/ws/2/release/" + metadata["musicbrainz_albumid"],
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Picard has already downloaded this information - why are you repeating the call?

album.tagger.webservice.get(
config.setting["server_host"],
config.setting["server_port"],
"/ws/2/release-group/" + metadata["musicbrainz_releasegroupid"],
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Picard has also already downloaded this information - why are you repeating the call?

@Sophist-UK
Copy link
Contributor

P.S. I encourage you to continue to work on this plugin - community contributions are always welcome IMO. But writing plugins does have a learning curve - sorry.

remove request of release, because its already there
set releation of release from processor
website:release-group_1_https://www.discogs.com/master/2831825'''
PLUGIN_LICENSE = "GPL-2.0"
PLUGIN_LICENSE_URL = "https://www.gnu.org/licenses/gpl-2.0.txt"
PLUGIN_VERSION = "1.0.1"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You don't need to increment the version except from one published version to another. This plugin has not yet been published, so you don't need to increment the version. But as previously stated, since this experimental it should probably be version 0.0.1 at the moment.

@@ -0,0 +1,140 @@
# -*- coding: utf-8 -*-
# Critiquebrainz plugin for Picard
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor point, but this is NOT the Critiquebrainz plugin.

set version to experimental minor number
@tobiasSarner
Copy link
Contributor Author

To that 3 points of ID3 tags.
I am working with vorbis flags on accurat encoded flac files, this compatiblity of website tag in IDv3 I will have a look to you plugin and will test it.
It should by possible to set, but the interpretation of this tag-type only on artist website is low and would be nice do differ that.
It could by like cover images by creation of tag by type and text/link.
I would like to see that information on playing track by do not searching it again in browser.

@Sophist-UK
Copy link
Contributor

  1. It doesn't matter what format you are talking about, if you want to load / save metadata in a way that it is useful e.g. to a player app, you need to ensure that the data will be saved in the correct way into the tags. Some formats (like ID3) get unknown metadata names mapped to e.g. a TXXX field, other formats just don't save it.

  2. Picard does not have any functionality designed to allow plugins to add new mappings. You might be able to monkey-patch it in (which might make the plugin much more specific to a Picard Release and more ,likely to break due to a code change in Picard, but it would IMO be easier (and by sticking to the API lower risk) to avoid monkey-patching and add a more comprehensive set of mappings to the next release of Picard.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants