Re: Works bot

Ian McEwen <[email protected]> Wed, 4 Mar 2015 14:08:49 -0700
Newsgroups gmane.comp.audio.musicbrainz.devel
Message-ID <[email protected]>
On Thu, Mar 05, 2015 at 12:11:43AM +1030, Daniel Sobey wrote:
> Hi list,
>
> I would like to write a bot for musicbrainz that automatically links
> recordings to works.
> When I add a work to musicbrainz I try and add all the existing recordings
> to the work.
> This can take time and you cannot keep track of all new recordings that are
> added to the database.
>

I think this would be useful, but please be sure to code conservatively
-- bots are getting more and more common in MB but we definitely don't
want this adding bad relationships that need to be cleaned up.

> What the bot would do is:
> 1. look through the database for works

You may want to internally track how recently you've checked a
particular work to try for reasonable coverage. Internal scripts for
updating coverart from Amazon work somewhat like this, where anything
newly-eligible for consideration is done first, then a limited number of
the least-recently-checked entities.

> 2. Look at all the recordings linked to that work and get the Name and list
> of artists on the recording
> 3. Find recordings with the exact same name and list of artist and see if
> they already have a recording to work relationship

This seems like a good start as far as this step, but also remember that
some transformations can happen. reosarevok's suggestion of avoiding
classical if you can is good (though discerning that can be hard). If
you're working directly from a database (which might be recommended --
the webservice will be quite slow for something like this) then the
musicbrainz_unaccent function (and things like lower(), of course) may
be useful.

> 4. submit an edit to add the recording to work relationship with the same
> flags as the reference recording ie cover, live
>
> Rate limiting:
> it should not look at works with open edits or are younger than 7 days.
> It should not look at recordings with any open edits or are younger than  7
> days.
> It should see if any of the releases that a recording is linked to has open
> edits or is younger than 7 days.
> it should not submit too many edits at one time.
>

http://wiki.musicbrainz.org/Code_of_Conduct/Bots will probably be
relevant as far as this stuff. I agree with the open edits and age
requirements for works and recordings as well. 7 days might be overkill
but it's a good conservative place to start.

>
> Currently this is in the idea stage with no code written yet.
> All feedback welcome.
>
> Regards,
>
> Daniel

> _______________________________________________
> MusicBrainz-devel mailing list
> [email protected]
> http://lists.musicbrainz.org/mailman/listinfo/musicbrainz-devel

_______________________________________________
MusicBrainz-devel mailing list
[email protected]
http://lists.musicbrainz.org/mailman/listinfo/musicbrainz-devel
signature.asc (application/pgp-signature, 181 B)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2

iEYEARECAAYFAlT3dF4ACgkQq+0avXExp28ksACfQbWWUQ9763PwLOvi54xpMXG3
jxYAn0JJ2i800ho2Rar6PcTZZtaRIrwx
=4D5S
-----END PGP SIGNATURE-----