Skip to content

Instantly share code, notes, and snippets.

View VonLatvala's full-sized avatar

Axel Latvala VonLatvala

View GitHub Profile
@VonLatvala
VonLatvala / sonarr-cancel-queue-sequentially.js
Last active March 2, 2024 11:23
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);
const clearVisibleAds = () => document.querySelectorAll('div[role=feed]>div[data-pagelet]').forEach(postDomEl => {
try {
Array.from(postDomEl.querySelectorAll('a[role=link]')[3].querySelectorAll(':scope>span>span')[1].children).forEach((el) => {
// Clear mock span text items to be able to read the actual text below
if(el.style.position == 'absolute') el.remove()
});
if(postDomEl.querySelectorAll('a[role=link]')[3].text == 'Sponsored') {
postDomEl.remove()
console.info('Cleared an ad');
}
// FROM http://www.daveamenta.com/2011-05/programmatically-or-command-line-change-the-default-sound-playback-device-in-windows-7/ [13.02.2018]
// ----------------------------------------------------------------------------
// PolicyConfig.h
// Undocumented COM-interface IPolicyConfig.
// Use for set default audio render endpoint
// @author EreTIk
// ----------------------------------------------------------------------------
#pragma once