[Scan-Script] TidyIt - Media Library House Cleaning

Share your scripts or request scripts with specific features.
Forum rules
Please keep the forum clean - one topic per script. Questions not related to a specific script should be posted in Support forum.
l2g
Posts: 227
Joined: 27 Jun 2014, 22:13
Contact:

Re: [Scan-Script] TidyIt - Media Library House Cleaning

Post by l2g » 05 Feb 2016, 16:23

habskilla wrote:My WDTV media player creates these .wdtv directories. Can you script handle these?
Absolutely,

Just add the .wdtv directory to the MetaContent setting of the script (settings). I'll look after making it a default directory in the next release of the script. Then you'll be good to go.

Run the script in Display mode (default setting anyway) first and just observer what it intends to do. I think you'll be happy with the results!

mike_sendrove
Posts: 3
Joined: 26 Jan 2016, 21:46

Re: [Scan-Script] TidyIt - Media Library House Cleaning

Post by mike_sendrove » 19 Feb 2016, 20:16

Hi - the reasons that I want to maintain my directory structure and leave empty folders is 1) because empty folders take up no space on my disk and 2) because as I watch tv episodes I remove and delete the video files from my library using my player client. However the client (KODI in my case) doesn't delete any of the metadata. I'd like to keep the folders intact to have a download location for future episodes which may not have been downloaded yet, but I do want to be able to automatically delete any redundant metadata. Does this make sense?

Thanks,
Mike.

l2g
Posts: 227
Joined: 27 Jun 2014, 22:13
Contact:

Re: [Scan-Script] TidyIt - Media Library House Cleaning

Post by l2g » 22 Feb 2016, 14:55

mike_sendrove wrote:Does this make sense?
Sorry Mike, I'm not trying to be difficult and thanks for justifying your situation! But there are flaws with what you want and how the script operates.

There is no way the script can determine that it's deleting the empty folder on just one level in such as /Movie/Path/Amazing.Movie/ or two levels in /TVShows/Path/Amazing.Show/S01/. So to expect different results for your TV Shows vs. your Movies unfortunately isn't going to happen I'm afraid.

KODI (XBMC), Synology setups, Plex, etc all know how to handle situations where an entire video is removed that it used to access (this is especially the case in your situation where you're using these very same tools to remove the video). These apps specifically only care about the absolute path to the video file and meta information. They operate on the fact the video is either there, or it isn't. If the video is gone; it doesn't care if the directory is there or not afterwards.

Not to mention that all of NZBGet's tools/scripts it uses or passes off it's content to such as VideoSort.py (NZBGet Script), CouchPotato, SickBeard, Sonaar, etc will all automatically recreate these (once empty) directories anyway when another video gets downloaded that belong in it. The automation is already there; you don't need to manually manage the directories yourself or leave it around.

In your case (wanting directories to remain present but empty), you might as well just leave all the meta information in the directories too and just not use this script at all. Especially since you're managing the directories manually anyway. The feature you're proposing is only going to save you 500K of disk space tops (a few jpegs) on your xTB hard disk (0.000001% of it).

Alternatively, have a look at the TidyIt setting entitled ProcessMinAge. This prevents directories from being handled until they haven't been manipulated or touched for more then this defined time (defined in seconds). If you increase this to a value something such as 259200 (3 days in seconds); the script will only begin looking at your manually managed directories then; this might work perfectly for you! You could also set it really high if you want to too such as 691200 (8 days). Feel free to keep setting it higher then that too (60 x 60 x 24 x days)

mike_sendrove
Posts: 3
Joined: 26 Jan 2016, 21:46

Re: [Scan-Script] TidyIt - Media Library House Cleaning

Post by mike_sendrove » 22 Feb 2016, 19:00

Thanks for such a comprehensive and useful response. I dint really know why I want to keep the empty directories, particularly since sonarr et al recreate them as necessary. I'll give it some thought.
Thanks again.

nerotic
Posts: 4
Joined: 28 Feb 2015, 13:35

Re: [Scan-Script] TidyIt - Media Library House Cleaning

Post by nerotic » 15 Sep 2016, 16:09

Thank you so much for this! :)

l2g
Posts: 227
Joined: 27 Jun 2014, 22:13
Contact:

Re: [Scan-Script] TidyIt - Media Library House Cleaning

Post by l2g » 19 Jul 2019, 23:14

It's been a while (almost 5 years), so I felt the need to update this script and slap a new build number on it.

Release v0.8.0 (Direct Download Link) is now in place.

The release details (and new documentation) can be found at the head of this thread (quick link).

Changes with this release:
  • Small bugfixes dating back to 2015 :oops:
  • Python 3 Support Added
  • it no longer ships with all of it's dependencies but instead includes a requirements.txt file. You will be required (just 1 time) to install them with

    Code: Select all

    pip install -r requirements.txt
    While this may seem annoying, it only has to be done once.

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests