How to run plugins on Picard as a developer

I have been trying to do some open source contributions , and want to fix some issues in the plugins in Picard . however I am unable to understand how to run any plugins .

I went to the Picard-plugins repository , and used git clone to clone the repository . Now I want to modify the abbreviate_artistsort plugin so that when the artist has no surname , the plugin rights now throws an exception , which should be ignored . So after cloning the repo and opening it in my code editor , I ran picard command from the terminal . This gives me the following window as popup Picard opening window

however I cant understand how to download , use and/or test plugins in Picard . Like suppose if i wanted to first test the abbreviate_artistsort as it is now , and then make some changes to it and test it after the changes , what should I do from here ? any help or step by step guide to how to do it would be appreciated , and if possible with images and screenshots would be greatly helpful . thanks .I am using the Mac OS , so if there are any differences in the process for that kindly inform me of the same as well .

also , I came across a lot of previous posts that told how to install plugins into Picard from the options>plugins , but my options does not have a plugin choice . here’s an image of what it looks like to me :

any advice in solving this would be appreciated .

1 Like

Your Apple seems to be missing an important menu item. There should be an Options on the Options menu.

image

Not sure why the menu says Python and not Picard… but then I don’t debug much on a Mac.

Thanks a lot for tackling some plugin issues.

The preferences are on macOS traditionally under the application menu with the title of the application. When running from source that’s the Python menu (in packaged Picard it would be named MusicBrainz Picard I think, maybe just Picard).

The plugins themselves need to be placed in the the plugin directory. I’m currently not fully sure where this is on macOS, but it will be available from within Plugins in the preferences dialog (there is an open plugin folder button).

For placing plugins there there are three options:

  1. When plugins get installed via Picard the plugins will be placed in the plugins directory as a ZIP file. For development that is less convenient
  2. Plugins from the plugin repository that have an __init__.pyA file need to be placed in a subdirectory with the name of the plugin (together with all files). Usually those are plugins having multiple files, but there are also a few with only a single __init__.py
  3. Plugins that only consist of a single Python file with the name of the plugin need that Python file directly placed in the plugin directory. That is for example the case for the abbreviate_artistsort.py plugin

For development I personally have the picard-plugins repository checked out at one place and then usually create symlinks in my user plugin directory to there. But sometimes I copy the files, especially for plugins I use myself and don’t want to loose latest changes just because I switch branches in my git repo.

Here is how my plugin directory looks like currently (on Linux, where it is in $HOME/.config/MusicBrainz/Picard/plugins:

-rw------- 1 phw phw 7,0K Jun  7  2022 acousticbrainz.zip
-rw------- 1 phw phw 3,0K Okt 13 21:24 additional_artists_variables.zip
-rw------- 1 phw phw 1,8K Dez 20  2022 albumartistextension.zip
-rw------- 1 phw phw 1,9K Apr 10  2022 albumartist_website.zip
drwxrwxr-x 3 phw phw 4,0K Okt 27 09:33 albumfoldercover
-rw------- 1 phw phw 1,3K Nov 27  2021 decade.zip
lrwxrwxrwx 1 phw phw   60 Sep 15 07:10 deezerart -> /home/phw/devel/musicbrainz/picard-plugins/plugins/deezerart
lrwxrwxrwx 1 phw phw   60 Mai 18  2021 fanarttv -> /home/phw/devel/musicbrainz/picard-plugins/plugins/fanarttv/
-rw------- 1 phw phw  49K Nov 27  2021 format_performer_tags.zip
-rw------- 1 phw phw 2,0K Dez 21  2021 happidev_lyrics.zip
-rw------- 1 phw phw 1,5K Aug  2  2021 instruments.zip
-rw------- 1 phw phw 1,2K Mai  4  2021 loadasnat.zip
lrwxrwxrwx 1 phw phw   68 Jan 11  2023 lookupexperiments -> /home/phw/devel/musicbrainz/picard-plugins/plugins/lookupexperiments
drwxrwxr-x 3 phw phw 4,0K Apr 20  2023 losslessfuncs
lrwxrwxrwx 1 phw phw   54 Jun  2  2022 mod -> /home/phw/devel/musicbrainz/picard-plugins/plugins/mod
drwxr-xr-x 3 phw phw 4,0K Apr 10  2021 opencc
-rw------- 1 phw phw 1,5K Apr 13  2021 papercdcase.zip
drwxrwxr-x 4 phw phw 4,0K Mär  7  2023 picard-submit-to-listenbrainz
lrwxrwxrwx 1 phw phw   71 Jan  5 18:05 playlist.py -> /home/phw/devel/musicbrainz/picard-plugins/plugins/playlist/playlist.py
drwxrwxr-x 2 phw phw 4,0K Jan  5 18:15 __pycache__
-rw------- 1 phw phw  605 Nov  3  2022 remove_perfect_albums.zip
lrwxrwxrwx 1 phw phw   62 Sep 13 14:35 replaygain2 -> /home/phw/devel/musicbrainz/picard-plugins/plugins/replaygain2
-rw-rw-r-- 1 phw phw  961 Mai 31  2021 rperformer.py
-rw------- 1 phw phw  12K Nov 27  2021 search_engine_lookup.zip
lrwxrwxrwx 1 phw phw   87 Dez 30  2022 smart_title_case.py -> /home/phw/devel/musicbrainz/picard-plugins/plugins/smart_title_case/smart_title_case.py
-rw------- 1 phw phw  10K Okt  2 17:34 submit_folksonomy_tags.zip
-rw------- 1 phw phw 5,1K Sep 10 13:52 submit_isrc.zip
-rw------- 1 phw phw 5,1K Jul 18  2021 theaudiodb.zip
-rw------- 1 phw phw  785 Jun 30  2021 tracks2clipboard.zip
-rw------- 1 phw phw 3,4K Okt  2  2022 viewvariables.zip
lrwxrwxrwx 1 phw phw   66 Sep 29  2022 workandmovement -> /home/phw/devel/musicbrainz/picard-plugins/plugins/workandmovement

You see that I have some plugins installed as ZIP, some are single .py files (like e.g. playlist.py or rperformer.py) and some are directories (e.g. albumfoldercover or fanarttv). And at least for the non-ZIP cases I have both the files or directory actually inside the plugins folder or as symlink to my checkout in /home/phw/devel/musicbrainz/picard-plugins/.

3 Likes