jerrymakesjelly / autoremove-torrents

Automatically remove torrents according to your strategies.
https://pypi.org/project/autoremove-torrents/
MIT License
726 stars 120 forks source link

Feature request - hardlinks count or add a pre/post script option #146

Open Jorman opened 2 years ago

Jorman commented 2 years ago

Hi, I'm making a bash script to better handle my torrents, the idea is pretty simple

The idea is: I delete only torrents (in certain categories) but only if seed time is enough and if hardlink count is more than 1. Usually I delete torrent only after x time and/or seeding time, but just came into my mind that I make hardlinks and maybe this "copy" stay in place for months, so, because is one hardlink don't take extra space and so, why delete it? is only one torrent that can help in seed ratio, I can delete it when the hardlinks count is 1 and all remaining conditions are good. I hope I explained my idea.

So for this reason I created a bash script that do all this pre-check, (only for selected categories) and after that call the autoremove-torrents to clean all remaining categories.

Or do you think that is possible to check hardlinks count inside autoremove-torrents? Make sense for you?

J

jerrymakesjelly commented 2 years ago

I think I get your point. Do you mean that you need a mechanism, which checks the hardlink count before deleting torrents, and only deletes torrent when the hardlink count of it equals to 1?

If so, I prefer to provide a mechanism to check the hardlink count in autoremove-torrents, instead of pre/post script option.

PS: I may need some time to implement it, because currently autoremove-torrents doesn't have the ability to fetch the file list.

Jorman commented 2 years ago

Yes, you got the point, equal to 1 and with the same logic, like seed time > X or all others function, like now. On qBittorren you already have the file, I made this for qBittorrent, but is a script! I use systemd timers so I can start it before your autoremove-torrents easily. https://github.com/Jorman/Scripts/blob/master/qBittorrentHardlinksChecker.sh qBittorrent save the path so I can easily check if the file have one or more hardlinks, maybe all others client have the saving path information from the API?

GlassedSilver commented 6 months ago

Any update on this? I find this EXTREMELY interesting, because it can help keep torrents healthy without having to manually figure out which ones are only stored anymore for seeding when you possibly already switched them out for something better for yourself, now wasting space.