rfsbraz / deleterr

Deleterr is a Python script designed to help you manage available disk space in your Plex media server.
MIT License
118 stars 6 forks source link

Archive, instead of delete? #42

Open DevMan01 opened 7 months ago

DevMan01 commented 7 months ago

Is there a function to define within the configuration, where you ask Deleterr to archive a show / movie, instead of deleting it?

This would behave the same way as the applications intention, except instead of deleting, it would move the intended file or files to a external hard drive, or a network drive, or some general location where files are to be archived.

Additional features might include zipping or tar’ing the file before officially archiving it.

rfsbraz commented 7 months ago

Hello!

I have a move action planned that can be used to move the files to a separate folder (updating the path in Sonarr/Radarr) , but looks like what you wan't is to still delete it from Sonarr/Radarr and just have it moved to a separate location? I can look into adding an archive option as well, but restoring would have to be done manually.

DevMan01 commented 7 months ago

Yes! I think you're right. The feature you've indicated is very similar. Perhaps it'd be a branch strategy:

graph TD
    A[Implement Move Action Type] --> B["Move and Purge"]
    A --> C["Move and Archive"]

    B --> D[Two-Stage Deletion Process]
    D --> E[Re-Index Media After Move]
    E --> I[Eventually Purge Media After Stage Two]

    C --> F[Compress Targeted Files]
    F --> G[Move Compressed Files to External Drive or Other Directory]
    G --> H[Remove the Media from Various `arr's]

Additionally I should mention, the idea behind the compression strategy should be inclusive to the individual media content item, matching the Plex folder structure.

There are two main folder structures for Plex, per their docs, Movies in Their Own Folders, or Stand-Alone Movie Files. Source

So, lets say the script identifies that one movie "Glass Onion" is prime to be archived. If movies are in their own folders, like this: /Media/Movies/The Glass Onion/The Glass Onion.mkv, then it would compress the entire contents of the sub-directory The Glass Onion into The Glass Onion.tar or something similar.

But if the media directory is organized using the Stand-Alone Movie Files, like this /Media/Movies/The Glass Onion.mkv, then it would create a .tar file of just the video file.

On a final note, I know this is a lot. But, I'm not too shabby at Python, if you have a story or a task you'd like help on in this regard, please, dont hesitate to shoot something my way.