se1exin / Cleanarr

A simple UI to help find and delete duplicate and sample files from your Plex server
https://hub.docker.com/r/selexin/cleanarr
MIT License
214 stars 18 forks source link

[feature request] able to ignore a location #141

Open pazport opened 4 months ago

pazport commented 4 months ago

Hello,

Would it be possible to add a setting or ENV so that cleanarr. would ignore a location from being deleted? Let's say. i have my movies split across 4 folders. but i don't want to delete any movies from folder B as that is a friends folder. but i would like to delete dupes from folder A C D? Would this possible?

Also keep up the good work :P

upamanyudas commented 4 days ago

A temporary solution until filtering / regex gets implemented in the UI. My example is to only select media with paths matching a certain word ("720P" in my case).

  1. Deselect all the checkboxes selected by default.
  2. Open the Console for your browser (⌘+⌥+I on a Mac and Ctrl+Alt+I on Windows)
  3. Type allow pasting in the console and hit Enter.
  4. Once you've done that, paste the JavaScript code snippet and press Enter.
// Count how many checkboxes are selected
let selectedCount = 0;

// Select all rows
const rows = document.querySelectorAll('.css-b5v4p5');

rows.forEach(row => {
    // Locate the file path and checkbox within each row
    const filePathElement = row.querySelector('div:nth-child(8) p');
    const checkbox = row.querySelector('input[type="checkbox"]');

    // Check if the file path contains "720P" and if the checkbox exists
    if (filePathElement && filePathElement.textContent.includes('720P') && checkbox) {
        if (!checkbox.checked) {  // Only click if not already checked
            checkbox.click();  // Simulate a click event to trigger any listeners
            selectedCount++;
        }
    }
});

console.log(`Total checkboxes selected: ${selectedCount}`);