Skip to content

feat: Add option to delete torrent after complete#398

Merged
lardbit merged 2 commits into
lardbit:masterfrom
disaac:disaac/closes-issue-396-add-option-to-delete-torrent-from-transmission-after-complete
Jul 12, 2026
Merged

feat: Add option to delete torrent after complete#398
lardbit merged 2 commits into
lardbit:masterfrom
disaac:disaac/closes-issue-396-add-option-to-delete-torrent-from-transmission-after-complete

Conversation

@disaac

@disaac disaac commented Jul 10, 2026

Copy link
Copy Markdown
Collaborator
.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: #396

* 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
@disaac disaac requested a review from lardbit July 10, 2026 17:10

@lardbit lardbit left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for submitting this PR! It's a convenient feature. I still need to test drive it but left a note

Comment thread src/nefarious/tasks.py Outdated
* 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
@disaac

disaac commented Jul 10, 2026

Copy link
Copy Markdown
Collaborator Author

Thanks for submitting this PR! It's a convenient feature. I still need to test drive it but left a note

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.

@disaac

disaac commented Jul 10, 2026

Copy link
Copy Markdown
Collaborator Author

@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.

Removed completed torrent from transmission: e9f15d43ee5686ac43bed193e159d39717d8afb0

@lardbit

lardbit commented Jul 12, 2026

Copy link
Copy Markdown
Owner

Excellent - I'm testing this today and will report back. Everything looks good.

@lardbit lardbit merged commit 1c78a7f into lardbit:master Jul 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants