DobyTang / LazyLibrarian

This project isn't finished yet. Goal is to create a SickBeard, CouchPotato, Headphones-like application for ebooks. Headphones is used as a base, so there are still a lot of references to it.
728 stars 72 forks source link

Remove from torrent client upon seeding completion? #1559

Closed ethanopp closed 5 years ago

ethanopp commented 6 years ago

Is there a way to have LL remove torrent from client (transmission in my case) upon seeding completion?

I'm thinking similar approach to how Sonarr/Radarr have their 'complete download handling' settings...

Also would be nice if it could also delete all the extra crap that sometimes gets downloaded along with the book file.

philborman commented 6 years ago

Should already do that, as long as "keep seeding" is not set in lazylibrarian config. Transmission tells us if the torrent is "finished", which means downloaded and seeded, so if you have seeding limits/ratios set in transmission we won't delete unless they are completed. We ask transmission to delete everything unless "keep originals" is set.

ethanopp commented 6 years ago

Hmm odd... I do not have keep seeding nor keep original files set...

I do have thresholds for seeding set in transmission, and they do get hit but end up just sitting there forever as a grey bar in the 'finished' state... Perhaps there is an issue with LL getting the response from Transmission that they are completed, or there is an issue sending the 'delete' command to transmission from LL?

...No errors in debug log

philborman commented 6 years ago

If the seeding threshold has not been hit by the time we postprocess the download, we won't ask transmission to delete it. There is currently no additional checking later, we only check once. I don't have seeding limits myself and everything gets tidied up ok. Maybe increase your postprocessing delay so we don't postprocess so soon, or can you set transmission to delete after seeding is complete, I know deluge can do that. We could maybe scan the history table every so often to check transmission until seeding is complete, but at the moment we don't store enough info to do it.

ethanopp commented 6 years ago

Ah yep that's definitely what is happening... seed ratio is 1.25 and deff not being hit before post processing (i think every 15?)

Unfortunately cant set transmission to delete because that then screws up the Sonarr/Radarr post processing that is being done

Scanning history every so often to check is an interesting idea though... Leaves the burden on LL as opposed to transmission

philborman commented 6 years ago

Looks like transmission is the only torrent downloader that does this, the others all delete even if not finished seeding, so it would be much simpler to change the transmission interface to do the same, maybe switchable in config, what do you think? Adding another task to scan history just for transmission seems a lit of work for little benefit.

ethanopp commented 6 years ago

The only setting in transmission I am aware of is the following: TRANSMISSION_TRASH_ORIGINAL_TORRENT_FILES=false

However if I set this to true, it messes with the complete download handler of Sonarr/Radarr since those applications handle everything from their side, and given that those files tend to be much larger than the book ones I'm giving them priority to make sure they seed correctly...

A while ago when I used couchpotato there was a way to set the seed ratio per indexer, do we have a setting in LL where we can set the seed ratio so it would overwrite the default transmission has?

If so I could just lower the seed ratio for the LL files and increase the post processing time so ideally they would just complete in time.

philborman commented 6 years ago

No, there is no seed ratio control in LL, we just ask if the torrent is "finished" which means downloaded and seeding ratio reached. We can easily change that to just checking if it's "complete" ie 100% downloaded, don't care about seeding ratio. I guess sonarr/radarr wait until seeding is complete and then ask for deletion, which is do-able but more complex, and ideally should be applied to all the torrent downloaders, not just transmission. At the moment all except transmission just delete when postprocessing is complete, don't care about seeding.

ethanopp commented 6 years ago

How can we change to check for just completion of download as opposed to completion of seeding?

philborman commented 6 years ago

Needs the code tweaking. Just testing it here.

philborman commented 5 years ago

Just posted that, Do not delete if still seeding option in downloader settings. Default is not to delete. Mylar, headphones, sonarr, radarr seem to just delete, no ratio control settings. I think it's simplest if we delete on completion if we want, or let the downloader handle it later when ratio is met.

ethanopp commented 5 years ago

When you say delete on completion, is that when its completed downloaded or completed seeding?

philborman commented 5 years ago

Delete after processing, so download is complete and we don't care if still seeding. The second tickbox stops you deleting if it's still seeding, but we don't check again, leave it up to the torrent downloader. Only transmission and qbittorrent tell us anyway, so the second tickbox has no effect on the other downloaders.

ethanopp commented 5 years ago

Okay I see the 2 options now - will give them a go!