You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am writing a plugin to override metadata and wish for it to apply when using beet mbsync. The documentation for plugin events implies that listening for albuminfo_received and trackinfo_received will allow me to do just that.
However, running beet -vv mbsync for a given query does not show a log message saying that the event was ever sent.
$ beet -vv mbsync 'album:autobahn'
user configuration: /home/ilianaw/.config/beets/config.yaml
data directory: /home/ilianaw/.config/beets
plugin paths: /home/ilianaw/.config/beets/plug
Sending event: pluginload
/usr/lib/python3.6/site-packages/beets/plugins.py:114: DeprecationWarning: inspect.getargspec() is deprecated, use inspect.signature() or inspect.getfullargspec()
argspec = inspect.getargspec(func)
library database: /home/ilianaw/.config/beets/library.db
library directory: /srv/media/ilianaw_music
Sending event: library_opened
Requesting MusicBrainz release f8fab745-79bd-31cd-be4b-ceb3d7e1e799
primary MB release type: album
mbsync: applying changes to Kraftwerk - Autobahn
Sending event: cli_exit
It appears (although I've not tested it) that this is a regression that occurred in 18a14e8. mbsync uses hooks.album_for_mbid, but only hooks.albums_for_id yields an albuminfo_received.
The solution that comes to my mind is to partially revert this commit by removing the @plugins.notify_info_yielded decorator on albums_for_id/tracks_for_id and using plugins.send. The use of @plugins.notify_info_yielded on album_candidates/item_candidates seems fine at first glance. If this sounds correct, I'll be happy to send a pull request.
Setup
OS: Fedora 28
Python version: 3.6.5
beets version: 1.4.6
Turning off plugins made problem go away (yes/no): no
(override is the plugin I am attempting to write.)
The text was updated successfully, but these errors were encountered:
iliana
changed the title
mbsync does not yield albuminfo_received/trackinfo_received as the docs suggest
mbsync does not yield albuminfo_received / trackinfo_received as the docs suggest
May 9, 2018
Thanks for your detective-work on this! I agree entirely with your astute diagnosis.
I've been trying to think of a way to salvage the decorator style, which is nice in itself, but I've been unable to come up with a better solution. So yes, I also concur with your idea to remove those decorators and replace them with explicit send calls---that seems like the most straightforward way to get both ID-based lookup functions to emit the right events.
Problem
I am writing a plugin to override metadata and wish for it to apply when using
beet mbsync
. The documentation for plugin events implies that listening foralbuminfo_received
andtrackinfo_received
will allow me to do just that.However, running
beet -vv mbsync
for a given query does not show a log message saying that the event was ever sent.It appears (although I've not tested it) that this is a regression that occurred in 18a14e8.
mbsync
useshooks.album_for_mbid
, but onlyhooks.albums_for_id
yields analbuminfo_received
.The solution that comes to my mind is to partially revert this commit by removing the
@plugins.notify_info_yielded
decorator onalbums_for_id
/tracks_for_id
and usingplugins.send
. The use of@plugins.notify_info_yielded
onalbum_candidates
/item_candidates
seems fine at first glance. If this sounds correct, I'll be happy to send a pull request.Setup
My configuration (output of
beet config
) is:(
override
is the plugin I am attempting to write.)The text was updated successfully, but these errors were encountered: