Skip to content

Instantly share code, notes, and snippets.

@VonLatvala
Last active March 2, 2024 11:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save VonLatvala/0c76a7ca9b3098a3b43ddd9ccf360ea6 to your computer and use it in GitHub Desktop.
Save VonLatvala/0c76a7ca9b3098a3b43ddd9ccf360ea6 to your computer and use it in GitHub Desktop.
Clear sonarr task queue sequentially
// Modified after testing, might not work but somewhat functional selectors. Hacky af too.
let timer = null;
const killh = ((timer) => {
return () => {
if (document.querySelectorAll('.Modal-modalContainer-xTUsI').length < 1) {
const cancelBtnSearch = document.querySelectorAll('#root > div > div.Page-main-Swphf > div.PageContent-content-C67P9 > div > div > fieldset:nth-child(2) > div > table > tbody > tr button');
if(calcelBtnSearch.length < 1) {
clearInterval(timer);
return;
}
cancelBtnSearch[0].click();
document.querySelectorAll('#portal-root > div:nth-child(3) > div > div > div > div > div.ModalFooter-modalFooter-wjkx5 > button.SpinnerButton-button-uE9hL.Button-button-paJ9a.Link-link-RInnp.SpinnerButton-button-uE9hL.Button-button-paJ9a.Link-link-RInnp.Button-danger-vthZW.Button-medium-ZwfFe.Link-link-RInnp')[0].click();
}
}
})(timer)
timer = setInterval(killh, 50);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment