Overseer - Hide Requested Items

Current "Fix" to https://github.com/sct/overseerr/issues/3681

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey, Greasemonkey किंवा Violentmonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

You will need to install an extension such as Tampermonkey or Violentmonkey to install this script.

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey किंवा Violentmonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल..

You will need to install an extension such as Tampermonkey or Userscripts to install this script.

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल..

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्क्रिप्ट व्यवस्थापक एक्स्टेंशन इंस्टॉल करावे लागेल.

(माझ्याकडे आधीच युझर स्क्रिप्ट व्यवस्थापक आहे, मला इंस्टॉल करू द्या!)

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला Stylus सारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला Stylus सारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला Stylus सारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्टाईल व्यवस्थापक इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्टाईल व्यवस्थापक इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्टाईल व्यवस्थापक इंस्टॉल करावे लागेल.

(माझ्याकडे आधीच युझर स्टाईल व्यवस्थापक आहे, मला इंस्टॉल करू द्या!)

// ==UserScript==
// @name         Overseer - Hide Requested Items
// @namespace    http://tampermonkey.net/
// @version      2024-12-18
// @description  Current "Fix" to https://github.com/sct/overseerr/issues/3681
// @author       You
// @match        https://yourdomain.com/*
// @icon         https://www.google.com/s2/favicons?sz=64&domain=github.com
// @grant        none
// @run-at       document-idle
// @license MIT
// ==/UserScript==

(function() {
    'use strict';

    // Function to hide specific list items
    const hideListItems = () => {
        document.querySelectorAll('li').forEach(li => {
            const parentDiv = li.querySelector('div.absolute.inset-0.h-full.w-full.overflow-hidden');
            if (parentDiv) {
                const targetDiv = parentDiv.querySelector('div.absolute.left-0.right-0.flex.items-center.justify-between.p-2');
                if (targetDiv) {
                    const additionalDiv = targetDiv.querySelector('div.pointer-events-none.z-40.flex.items-center');
                    if (additionalDiv) {
                        li.style.display = 'none';
                    }
                }
            }
        });
    };

    // Function to always show a specific button div
    const showButtonDiv = () => {
        document.querySelectorAll('div.absolute.bottom-0.left-0.right-0.flex.justify-between.px-2.py-2').forEach(buttonDiv => {
            buttonDiv.style.display = ''; // Removes any previous inline style that hides the element
        });
    };

    // Initial invocation
    hideListItems();
    showButtonDiv();

    // Observe for any added nodes to apply changes dynamically
    const observer = new MutationObserver(() => {
        hideListItems();
        showButtonDiv();
    });

    observer.observe(document.body, { childList: true, subtree: true });
})();