Skip to content

Commit

Permalink
Fix dialog box selector in editor
Browse files Browse the repository at this point in the history
  • Loading branch information
Jerome-Roy authored and loujine committed Nov 25, 2024
1 parent 3794c8a commit a625704
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 19 deletions.
6 changes: 3 additions & 3 deletions mb-edit-edit_subworks.user.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
// @name MusicBrainz edit: Replace subwork titles, disambiguations and attributes in Work edit page
// @namespace mbz-loujine
// @author loujine
// @version 2023.3.11
// @version 2024.11.25
// @downloadURL https://raw.githubusercontent.com/loujine/musicbrainz-scripts/master/mb-edit-edit_subworks.user.js
// @updateURL https://raw.githubusercontent.com/loujine/musicbrainz-scripts/master/mb-edit-edit_subworks.user.js
// @supportURL https://github.com/loujine/musicbrainz-scripts
Expand Down Expand Up @@ -127,10 +127,10 @@ function setSubworksAttributes(attrName) {
button.click();
await helper.waitFor(() => !!MB.relationshipEditor.relationshipDialogDispatch, 1);

document.querySelector(`.dialog-content input#${attrName}-checkbox`).click();
document.querySelector(`.relationship-dialog input#${attrName}-checkbox`).click();
await helper.delay(1);

document.querySelector('.dialog-content button.positive').click();
document.querySelector('.relationship-dialog button.positive').click();
});
}

Expand Down
2 changes: 1 addition & 1 deletion mb-reledit-copy_dates.user.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
// @name MusicBrainz relation editor: Copy dates on recording relations
// @namespace mbz-loujine
// @author loujine
// @version 2024.4.11
// @version 2024.11.25
// @downloadURL https://raw.githubusercontent.com/loujine/musicbrainz-scripts/master/mb-reledit-copy_dates.user.js
// @updateURL https://raw.githubusercontent.com/loujine/musicbrainz-scripts/master/mb-reledit-copy_dates.user.js
// @supportURL https://github.com/loujine/musicbrainz-scripts
Expand Down
14 changes: 7 additions & 7 deletions mb-reledit-guess_works.user.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
// @name MusicBrainz relation editor: Guess related works in batch
// @namespace mbz-loujine
// @author loujine
// @version 2023.3.12
// @version 2024.11.25
// @downloadURL https://raw.githubusercontent.com/loujine/musicbrainz-scripts/master/mb-reledit-guess_works.user.js
// @updateURL https://raw.githubusercontent.com/loujine/musicbrainz-scripts/master/mb-reledit-guess_works.user.js
// @supportURL https://github.com/loujine/musicbrainz-scripts
Expand Down Expand Up @@ -78,11 +78,11 @@ const setWork = async (recording, work, partial) => {
}
await helper.delay(1);

if (document.querySelector('.dialog-content p.error')) {
if (document.querySelector('.relationship-dialog p.error')) {
console.error('Dialog error, probably an identical relation already exists');
document.querySelector('.dialog-content button.negative').click();
document.querySelector('.relationship-dialog button.negative').click();
} else {
document.querySelector('.dialog-content button.positive').click();
document.querySelector('.relationship-dialog button.positive').click();
}
};

Expand Down Expand Up @@ -113,11 +113,11 @@ const replaceWork = async (recording, work) => {
});
await helper.delay(1);

if (document.querySelector('.dialog-content p.error')) {
if (document.querySelector('.relationship-dialog p.error')) {
console.error('Dialog error, probably an identical relation already exists');
document.querySelector('.dialog-content button.negative').click();
document.querySelector('.relationship-dialog button.negative').click();
} else {
document.querySelector('.dialog-content button.positive').click();
document.querySelector('.relationship-dialog button.positive').click();
}
};

Expand Down
4 changes: 2 additions & 2 deletions mb-reledit-set_instruments.user.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
// @name MusicBrainz relation editor: set role in recording-artist relation
// @namespace mbz-loujine
// @author loujine
// @version 2023.3.6
// @version 2024.11.25
// @downloadURL https://raw.githubusercontent.com/loujine/musicbrainz-scripts/master/mb-reledit-set_instruments.user.js
// @updateURL https://raw.githubusercontent.com/loujine/musicbrainz-scripts/master/mb-reledit-set_instruments.user.js
// @supportURL https://github.com/loujine/musicbrainz-scripts
Expand Down Expand Up @@ -78,7 +78,7 @@ const setInstrument = (fromType, toType, fromAttrId, toAttrId, toCredit) => {
});
await helper.delay(1);

document.querySelector('.dialog-content button.positive').click();
document.querySelector('.relationship-dialog button.positive').click();
});
});
};
Expand Down
8 changes: 4 additions & 4 deletions mb-reledit-set_rec_artist_as_writer.user.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
// @name MusicBrainz relation editor: Set writer relation from recording artist
// @namespace mbz-loujine
// @author loujine
// @version 2023.3.28
// @version 2024.11.25
// @downloadURL https://raw.githubusercontent.com/loujine/musicbrainz-scripts/master/mb-reledit-set_rec_artist_as_writer.user.js
// @updateURL https://raw.githubusercontent.com/loujine/musicbrainz-scripts/master/mb-reledit-set_rec_artist_as_writer.user.js
// @supportURL https://github.com/loujine/musicbrainz-scripts
Expand Down Expand Up @@ -81,11 +81,11 @@ const fillWriterDialog = async (work, track, artistCredit) => {
});
await helper.delay(10);

if (document.querySelector('.dialog-content p.error')) {
if (document.querySelector('.relationship-dialog p.error')) {
console.error('Dialog error, probably an identical relation already exists');
document.querySelector('.dialog-content button.negative').click();
document.querySelector('.relationship-dialog button.negative').click();
} else {
document.querySelector('.dialog-content button.positive').click();
document.querySelector('.relationship-dialog button.positive').click();
}
};

Expand Down
4 changes: 2 additions & 2 deletions mb-reledit-set_relation_attrs.user.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
// @name MusicBrainz relation editor: Set relation attributes
// @namespace mbz-loujine
// @author loujine
// @version 2023.3.6
// @version 2024.11.25
// @downloadURL https://raw.githubusercontent.com/loujine/musicbrainz-scripts/master/mb-reledit-set_relation_attrs.user.js
// @updateURL https://raw.githubusercontent.com/loujine/musicbrainz-scripts/master/mb-reledit-set_relation_attrs.user.js
// @supportURL https://github.com/loujine/musicbrainz-scripts
Expand Down Expand Up @@ -58,7 +58,7 @@ const setAttributes = (targetType, attrName, toggle) => {
});
await helper.delay(1);

document.querySelector('.dialog-content button.positive').click();
document.querySelector('.relationship-dialog button.positive').click();
});
});
};
Expand Down

0 comments on commit a625704

Please sign in to comment.