feat: Add option to delete torrent after complete#398
Conversation
* Added a default-off setting `remove_completed_torrents_from_transmission` in [models.py](src/nefarious/models.py:62) with migration [0099_nefarioussettings_remove_completed_torrents_from_transmission](migrations/0099_nefarioussettings_remove_completed_torrents_from_transmission.py) * After completed media is moved/renamed and the import task succeeds, nefarious now queues `remove_completed_torrent_task` in [tasks.py](src/nefarious/tasks.py). When enabled, it removes the torrent from Transmission with `delete_data=False`, then clears the stored torrent hash/name. * Also added the setting to the Transmission settings UI in [settings.component.html](src/frontend/src/app/settings/settings.component.html:77) and [settings.component.ts](src/frontend/src/app/settings/settings.component.ts:48). * Validated running ```bash .venv/bin/python src/manage.py test nefarious.tests.test_remove_completed_torrent #passed .venv/bin/python src/manage.py makemigrations --check --dry-run #passed .venv/bin/python src/manage.py check #passed npm --prefix src/frontend run build #passed ``` Closes Github Issue: lardbit#396
lardbit
left a comment
There was a problem hiding this comment.
Thanks for submitting this PR! It's a convenient feature. I still need to test drive it but left a note
* Addresses [@lardbit comment on PR lardbit#398](lardbit#398 (comment)) instead of erroring with a 404 throwing an Exception since this is a celery task not http. Fixes Github Issue: lardbit#396
I have been automating this on my deployment but figured it would be a handy feature my only reluctance was creating more leaches 😜but figure with it off by default thats fine. |
|
@lardbit I merged #400 #398 on my fork master and it properly built and pushed the image with the updates to my ghcr. I then pointed my live docker-compose.yml at the updated ghcr image pulled and did a force recreate and verified with a new torrent download that it successfully removed the torrent from transmission after enabling the feature in my settings. So option seemed to work as expected on my deployment. |
|
Excellent - I'm testing this today and will report back. Everything looks good. |
remove_completed_torrents_from_transmissionin models.py with migration 0099_nefarioussettings_remove_completed_torrents_from_transmissionremove_completed_torrent_taskin tasks.py. When enabled, it removes the torrent from Transmission withdelete_data=False, then clears the stored torrent hash/name.Closes Github Issue: #396