Fixed my own mistake again.

.find() should have been used instead of .children() but, as we had to
chain .find().filter(), using plain .querySelector() is more straightforward.
I should stop editing this script, I don’t know jQuery (enough).
This commit is contained in:
jesus2099 2016-05-30 12:51:42 +02:00
parent 1a8ce4c6c8
commit af46f1f6ae

View file

@ -1,6 +1,6 @@
// ==UserScript==
// @name MusicBrainz: Set recording comments for a release
// @version 2016.5.24
// @version 2016.5.30
// @author Michael Wiencek
// @namespace 790382e7-8714-47a7-bfbd-528d0caa2333
// @downloadURL https://bitbucket.org/mwiencek/userscripts/raw/master/set-recording-comments.user.js
@ -140,7 +140,7 @@ function setRecordingComments() {
$input.css("border-color", "red").prop("disabled", false);
});
var link = $(track).children("td a[href^=\\/recording\\/]").filter(":first"),
var link = track.querySelector("td a[href^='/recording/']"),
mbid = link.href.match(MBID_REGEX)[0];
editData.push({edit_type: EDIT_RECORDING_EDIT, to_edit: mbid, comment: comment});