StuffAnThings / qbit_manage

This tool will help manage tedious tasks in qBittorrent and automate them. Tag, categorize, remove Orphaned data, remove unregistered torrents and much much more.
MIT License
639 stars 42 forks source link

[FR]: Have QbitManage not remove empty category directories #501

Closed danclay closed 3 months ago

danclay commented 4 months ago

Is your feature request related to a problem? Please elaborate.

Qbitmanage removes empty category directories when an orphaned file removal or cleanup empties it. This can cause errors in other software which reference the category directories, such as cross-seed. However, it does not appear to remove the empty category directories when no cleanup occurs.

Describe the solution you'd like

QBitmanage could check the directories it wishes to remove against the "cat" section in the config and only remove empty directories above the categories. This could potentially be an option if this would for some reason mess up other setups.

Does your solution involve any of the following?

Describe alternatives you've considered

I have considered having a script just run at an interval to recreate the folders since Qbitmanage does not remove them if there are no cleanup operations within the directory. However, this is janky. I may still implement this alternative though in the meantime.

Who will this benefit?

Users of other programs which touch Qbittorrent's downloads directory.

Additional Information

e.g. I have a category /data/qbittorrent/sonarr_uhd which is often empty since I avoid UHD shows to conserve disk space. Qbitmanage can remove /data/qbittorrent/sonarr_uhd/randomshow1 when empty but keep /data/qbittorrent/sonarr_uhd.

hamcoremusic commented 4 months ago

I am having the same issue where it deletes the folder then cross-seed and the starr apps get a little angry. The starr apps do recreate the folder, however cross-seed will error out.