Skip to content

Repository files navigation

DND Cleaner — BiglyBT plugin

Removes the per-torrent active/<hash>/dnd folders that BiglyBT keeps for de-selected ("do not download") files. When you untick files, BiglyBT moves the already-downloaded boundary-piece data into that folder and keeps it until the torrent is removed with data. For users who accumulate downloads rather than seed, this is dead weight. The built-in Command Runner can only fire once, on completion — it never runs on stop or on file de-select, and never for already-completed torrents. This plugin fixes exactly that gap.

Why this plugin exists (no existing alternative)

As of this writing there is no plugin in the BiglyBT catalogue that cleans the dnd folders. "Download Deleter and Starter" deletes whole downloads by share ratio; the Command Runner only fires once on completion. BiglyBT's own wiki states that de-selected data is kept on purpose (so a torrent can be reseeded), and the only built-in options are rename with an extension or move to a subfolder. This plugin fills that gap for the accumulate-don't-seed workflow.

Localization

Ships with English, Russian (ru) and Spanish (es); other locales fall back to English.

What it does

  • On stop — cleans a torrent's dnd the moment it enters the stopped state.
  • Periodic scan — also catches files de-selected on already-completed torrents and orphaned folders left behind by remove-from-list (keep data).
  • Clean now — a one-click full sweep (replaces any external cleanup script).

Safety

  • Never touches an actively downloading torrent (its boundary pieces are in use).
  • Seeding torrents are skipped unless you explicitly opt in.
  • Never deletes the flat <hash>.dat / .dat.bak state files — only the <hash>/dnd subtree (and the now-empty <hash> dir, like BiglyBT itself).
  • Settle delay so an in-progress move into dnd is not deleted mid-flight.
  • Dry-run mode logs what would be freed without deleting anything.

Windows note: while a torrent is seeding, BiglyBT keeps the files inside dnd open (they hold boundary pieces of the data being served), and Windows does not allow deleting open files. So on Windows the dnd folder can only be removed once the torrent stops — which the Clean when a torrent is stopped trigger does automatically. Clean while seeding too therefore only has an effect on Linux/macOS. If you accumulate downloads without seeding, set your torrents to stop on completion and the plugin will clean them on stop.

Options (Tools → Options → Plugins → DND Cleaner)

Option Default Meaning
Enable DND Cleaner on master switch
Clean when a torrent is stopped on event-driven trigger
Background scan interval (secs) [0: disabled] 60 how often it scans & removes leftover dnd; 0 disables (then only on stop / Clean now)
Settle delay before deleting (secs) 8 wait for move-into-dnd to finish
Completed downloads only on protects still-downloading torrents
Clean while seeding too off tries to clean during seeding; Linux/macOS only — on Windows the dnd files are locked until the torrent stops
Clean orphaned folders (hashes not in list) on clean dnd for hashes no longer in your list; turn off to only touch currently-loaded downloads
Also remove the empty <hash> folder on the dnd sits in a BiglyBT folder named by the torrent's infohash; remove it if empty (not your downloads; .dat/.bak never touched)
Custom active/DND folder blank only if you set an Alternative Location for DND Files
Dry run - log only, delete nothing off logs what it would remove, marked [dry-run]; turn off for real cleaning
Clean everything now manual full sweep

A running counter shows total folders cleaned and bytes freed (persisted).

Install

Easiest (in-app): in BiglyBT, Plugins → Installation Wizard → By File, choose dndcleaner_1.0.jar, finish the wizard, and restart if prompted.

Manual (drop-in):

  1. Close BiglyBT.
  2. Put the jar at %APPDATA%\BiglyBT\plugins\dndcleaner\dndcleaner_1.0.jar (create the dndcleaner folder). On Linux/macOS use ~/.config/BiglyBT/plugins/... or ~/Library/Application Support/BiglyBT/plugins/.... (The exact per-user plugin folder is shown at the top of Tools → Options → Plugins.)
  3. Start BiglyBT → Tools → Options → Plugins → DND Cleaner.
  4. First-time tip: enable Dry run (log only, delete nothing), click Clean now, and check the "DND Cleaner" log channel to see what it would remove. Then turn dry-run off.

Verified in a live BiglyBT core

Beyond the mocked unit/integration suites, the plugin has been run inside a real (headless) BiglyBT core: it is discovered and loaded from its jar by BiglyBT's own plugin loader, and both a manual sweep and the plugin's own scheduled scan remove a real active/<hash>/dnd folder while the <hash>.dat / .bak state files are left untouched. See test/integration/HeadlessIT.java (opt-in; needs the full BiglyBT application jar and boots a core, so it is not part of build.sh/CI).

For an end-to-end check against real torrents over the network, see test/integration/NetworkDemoIT.java (run via test/integration/run-network-demo.sh). It adds three real Internet Archive torrents (each shipping per-OS builds incl. a macOS file), unticks their files so BiglyBT itself writes the real active/<hash>/dnd folders, drives all three into the seeding state, and verifies the seeding rules: with clean_while_running off none of the seeding folders are touched, and with it on every one of them is removed. Also opt-in (needs the full BiglyBT application jar plus network access to archive.org), so it is likewise not part of build.sh/CI.

Reproducing BiglyBT creating a dnd folder requires a live multi-file torrent with de-selected files and the "alternative location for DND files" option; that is BiglyBT's own behaviour (see DownloadManager source), exercised by the network demo above. The offline suites validate the plugin's detection and cleaning deterministically.

Build from source

Requires a JDK 21 (javac/java/jar on PATH). The plugin is compiled with --release 8, so the jar loads on BiglyBT's bundled Java 8 runtime.

./build.sh

The script downloads the BiglyBT API jar if absent, compiles, runs all test suites (DndFsTest, PluginIT, FullIT) and produces dndcleaner_<version>.jar. CI (GitHub Actions, .github/workflows/build.yml) runs the same on every push. Eclipse users can import the project and export the jar via dndcleaner.jardesc (the standard BiglyBT-plugin build descriptor). Built and tested against BiglyBT 4.1.0.0 (Java 21). Uses two stable core helpers (FileUtil.getUserFile, ByteFormatter) in addition to the public plugin API.

License

MIT — see LICENSE.

About

BiglyBT plugin that cleans the leftover active/<hash>/dnd folders BiglyBT keeps for de-selected ("do not download") files. Safe: dry-run option, data preserved, never deletes .dat/.bak. Localized EN/RU/ES.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages