From 4603477bedfda514761290ad5d8db4de1e3c16d8 Mon Sep 17 00:00:00 2001 From: GENERAL868 <212038781+GENERAL868@users.noreply.github.com> Date: Mon, 9 Nov 2026 23:56:23 +0400 Subject: [PATCH 1/4] Start version numbers over at 0.1.0 --- .github/ISSUE_TEMPLATE/bug_report.yml | 2 +- .github/workflows/release.yml | 2 +- CHANGELOG.md | 14 ++++++++++++++ package-lock.json | 4 ++-- package.json | 2 +- src-tauri/Cargo.lock | 2 +- src-tauri/Cargo.toml | 2 +- src-tauri/tauri.conf.json | 2 +- 8 files changed, 22 insertions(+), 8 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml index 3ac8f38..613ca48 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.yml +++ b/.github/ISSUE_TEMPLATE/bug_report.yml @@ -24,7 +24,7 @@ body: attributes: label: Flowbit version description: Shown at the bottom of Preferences. - placeholder: "1.3.0" + placeholder: "0.1.0" validations: required: true - type: dropdown diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 36b855b..97f903a 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -8,7 +8,7 @@ on: workflow_dispatch: inputs: tag: - description: Release tag, like v1.4.0 + description: Release tag, like v0.1.0 required: true permissions: diff --git a/CHANGELOG.md b/CHANGELOG.md index 365c377..eba4cd9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,20 @@ All notable changes to Flowbit. Versions follow [Semantic Versioning](https://semver.org). +## 0.1.0 - Unreleased + +Version numbers start over at 0.1.0 with this release. Releases 1.3.0 to 1.4.0 below came before it. + +### Added + +- **Select all**: tick torrents in the list, or all of them, and remove them together, with or + without their files. + +### Fixed + +- Reopening Flowbit no longer repeats the "Download finished" notification for torrents that + finished earlier. + ## [1.4.0] - 2026-11-07 ### Added diff --git a/package-lock.json b/package-lock.json index d20f79a..3995b31 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "flowbit", - "version": "1.4.0", + "version": "0.1.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "flowbit", - "version": "1.4.0", + "version": "0.1.0", "license": "MIT", "devDependencies": { "@tauri-apps/cli": "2.12.3" diff --git a/package.json b/package.json index ec54a60..4fee8b8 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "flowbit", - "version": "1.4.0", + "version": "0.1.0", "private": true, "description": "Streaming torrent client for Windows: Rust (librqbit, Tauri) and mpv", "license": "MIT", diff --git a/src-tauri/Cargo.lock b/src-tauri/Cargo.lock index ebaf695..bd544cf 100644 --- a/src-tauri/Cargo.lock +++ b/src-tauri/Cargo.lock @@ -1356,7 +1356,7 @@ dependencies = [ [[package]] name = "flowbit" -version = "1.4.0" +version = "0.1.0" dependencies = [ "anyhow", "libc", diff --git a/src-tauri/Cargo.toml b/src-tauri/Cargo.toml index 1a115c4..18abcae 100644 --- a/src-tauri/Cargo.toml +++ b/src-tauri/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "flowbit" -version = "1.4.0" +version = "0.1.0" description = "Streaming torrent client" authors = ["Flowbit contributors"] license = "MIT" diff --git a/src-tauri/tauri.conf.json b/src-tauri/tauri.conf.json index 7cdaf2e..81dc835 100644 --- a/src-tauri/tauri.conf.json +++ b/src-tauri/tauri.conf.json @@ -2,7 +2,7 @@ "$schema": "https://schema.tauri.app/config/2", "productName": "Flowbit", "mainBinaryName": "Flowbit", - "version": "1.4.0", + "version": "0.1.0", "identifier": "app.flowbit.desktop", "build": { "frontendDist": "../ui" From 5db776ea2a522e9c1075d99968ffa89f64622284 Mon Sep 17 00:00:00 2001 From: GENERAL868 <212038781+GENERAL868@users.noreply.github.com> Date: Mon, 9 Nov 2026 23:56:24 +0400 Subject: [PATCH 2/4] Don't repeat finished notifications after a restart While a restored torrent is being checked it reports not finished, so the first pass of the watcher missed it and a later pass announced it as new. Restored torrents now only count once they've been seen missing data after the check. --- src-tauri/src/lib.rs | 72 +++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 71 insertions(+), 1 deletion(-) diff --git a/src-tauri/src/lib.rs b/src-tauri/src/lib.rs index a2f0235..43c641d 100644 --- a/src-tauri/src/lib.rs +++ b/src-tauri/src/lib.rs @@ -813,10 +813,32 @@ fn open_args(app: &AppHandle, args: Vec) { }); } +/// Tells downloads finishing now from finished torrents being reloaded at startup. +/// While a restored torrent is being checked it reports "not finished", so it only +/// counts once it has been seen missing data after the check. +#[derive(Default)] +struct FinishNotices { + restored: HashSet, + incomplete: HashSet, +} + +impl FinishNotices { + fn observe(&mut self, info_hash: &str, state: &str, finished: bool) { + if !finished && matches!(state, "live" | "paused") { + self.incomplete.insert(info_hash.to_owned()); + } + } + + fn downloaded_now(&self, info_hash: &str) -> bool { + !self.restored.contains(info_hash) || self.incomplete.contains(info_hash) + } +} + /// Notifies when downloads finish, pauses them if they shouldn't seed, and keeps /// the tray tooltip's speeds current async fn watch_torrents(app: AppHandle) { let mut finished: HashSet = HashSet::new(); + let mut notices = FinishNotices::default(); let mut first = true; let mut last_count = 0; loop { @@ -826,7 +848,11 @@ async fn watch_torrents(app: AppHandle) { }; let torrents = engine.list(); let prefs = state.prefs(); + if first { + notices.restored = torrents.iter().map(|t| t.info_hash.clone()).collect(); + } for t in &torrents { + notices.observe(&t.info_hash, t.state, t.finished); if t.state == "live" && stops_when_done(&state, &prefs, t) { engine.pause(t.id).await.ok(); } @@ -847,7 +873,7 @@ async fn watch_torrents(app: AppHandle) { paths.iter().for_each(|p| posters::mark_of_the_web(p)) }); } - if first { + if !notices.downloaded_now(&t.info_hash) { continue; } let name = t.name.clone().unwrap_or_else(|| "Torrent".into()); @@ -1074,3 +1100,47 @@ fn sanitize_file_name(name: &str) -> String { }) .collect() } + +#[cfg(test)] +mod tests { + use super::*; + + fn restored() -> FinishNotices { + FinishNotices { + restored: HashSet::from(["a".to_owned()]), + ..Default::default() + } + } + + #[test] + fn a_finished_torrent_checked_at_startup_is_not_announced() { + let mut notices = restored(); + notices.observe("a", "initializing", false); + notices.observe("a", "paused", true); + assert!(!notices.downloaded_now("a")); + } + + #[test] + fn a_restored_download_that_completes_is_announced() { + let mut notices = restored(); + notices.observe("a", "initializing", false); + notices.observe("a", "live", false); + notices.observe("a", "live", true); + assert!(notices.downloaded_now("a")); + } + + #[test] + fn a_restored_torrent_that_failed_is_not_counted_as_incomplete() { + let mut notices = restored(); + notices.observe("a", "error", false); + notices.observe("a", "paused", true); + assert!(!notices.downloaded_now("a")); + } + + #[test] + fn a_torrent_added_while_running_is_announced() { + let mut notices = restored(); + notices.observe("b", "live", true); + assert!(notices.downloaded_now("b")); + } +} From fad79ab59ce4be57fcc63186064f8feffed1f204 Mon Sep 17 00:00:00 2001 From: GENERAL868 <212038781+GENERAL868@users.noreply.github.com> Date: Mon, 9 Nov 2026 23:56:24 +0400 Subject: [PATCH 3/4] Select torrents and remove them together A checkbox on each torrent and a Select all box above the list. Only torrents on screen count, so a filter or search can't hide what gets removed. --- ui/app.css | 3 +- ui/app.js | 82 +++++++++++++++++++++++++++++++++++++++++++++++++++- ui/i18n.js | 14 +++++++++ ui/style.css | 18 ++++++++++++ 4 files changed, 115 insertions(+), 2 deletions(-) diff --git a/ui/app.css b/ui/app.css index c5637dc..db0ef28 100644 --- a/ui/app.css +++ b/ui/app.css @@ -100,7 +100,8 @@ body { margin-top: 1px; } -.modal-content .check-row { +.modal-content .check-row, +.bulk-bar .check-row { display: flex; align-items: center; gap: 10px; diff --git a/ui/app.js b/ui/app.js index eb00636..7ac5710 100644 --- a/ui/app.js +++ b/ui/app.js @@ -21,6 +21,7 @@ const state = { expanded: null, // id of the torrent whose files are shown files: {}, // torrent id -> file list menu: null, // id of the torrent whose "more" menu is open + selected: new Set(), // ids of the torrents ticked in the list modal: null, visible: true, engineError: null, @@ -316,9 +317,32 @@ function renderHome () { : state.filter === 'all' ? tt('home.empty') : tt('home.emptyFilter') html = `
${message}${tt('home.emptyHint')}
` } else { - html = `
    ${torrents.map(renderTorrent).join('')}
` + html = `${renderBulkBar(torrents)}
    ${torrents.map(renderTorrent).join('')}
` } setHTML($('list'), html) + + const selectAll = $('select-all') + if (selectAll) { + const count = selectedAmong(torrents).length + selectAll.indeterminate = count > 0 && count < torrents.length + } +} + +// Only what's on screen counts, so a filter or search can't hide what gets removed +function selectedAmong (torrents) { + return torrents.filter((t) => state.selected.has(t.id)) +} + +function renderBulkBar (torrents) { + const count = selectedAmong(torrents).length + const remove = count + ? `${tt('bulk.selected', { count })} + ` + : '' + return `
+ + ${remove} +
` } // Torrents already drawn once, so only new ones fade in @@ -379,6 +403,7 @@ function renderTorrent (t) { return `
  • ${esc(x.name || '…')}
  • `).join('') + body = `

    ${tt('remove.titleMany', { count: m.torrents.length })}

    +
      ${names}
    + + ` } root.innerHTML = `` @@ -1104,6 +1139,9 @@ async function refresh () { for (const id of Object.keys(state.files)) { if (!snapshot.torrents.some((x) => String(x.id) === id)) delete state.files[id] } + for (const id of state.selected) { + if (!snapshot.torrents.some((x) => x.id === id)) state.selected.delete(id) + } loadPosters(snapshot.torrents) } catch (err) { state.engineError = String(err) @@ -1144,6 +1182,34 @@ async function addPathList (paths) { } } +function onSelectTorrent (el) { + const id = Number(el.dataset.id) + if (el.checked) state.selected.add(id) + else state.selected.delete(id) + renderHome() +} + +function onSelectAll (el) { + for (const t of visibleTorrents()) { + if (el.checked) state.selected.add(t.id) + else state.selected.delete(t.id) + } + renderHome() +} + +// Keeps going if one fails, then reports the first error +async function removeMany (ids, deleteFiles) { + let failure = null + for (const id of ids) { + try { + await invoke('remove', { id, deleteFiles }) + } catch (err) { + failure = failure ?? err + } + } + if (failure !== null) throw failure +} + async function act (promise, after) { try { const result = await promise @@ -1284,6 +1350,18 @@ function handleAction (el, event) { act(invoke('remove', { id: torrent, deleteFiles })) break } + case 'remove-selected': + openModal({ id: 'remove-many', torrents: selectedAmong(visibleTorrents()).map((x) => x.id) }) + break + case 'confirm-remove-many': { + const deleteFiles = $('delete-files').checked + const ids = state.modal.torrents + closeModal() + sound('delete') + if (ids.includes(state.expanded)) state.expanded = null + act(removeMany(ids, deleteFiles)) + break + } case 'set-pref': updatePref(el.dataset.pref, el.dataset.value) break @@ -1408,6 +1486,8 @@ async function start () { document.addEventListener('change', (e) => { const el = e.target if (el.dataset.action === 'include-file') onIncludeFile(el) + else if (el.dataset.action === 'select-torrent') onSelectTorrent(el) + else if (el.id === 'select-all') onSelectAll(el) else if (el.dataset.action === 'set-watched') onSetWatched(el) else if (el.id === 'tr-save-as') state.tr.saveAs = el.checked else if (el.dataset.pref) onPrefInput(el) diff --git a/ui/i18n.js b/ui/i18n.js index fa50564..cbddfcc 100644 --- a/ui/i18n.js +++ b/ui/i18n.js @@ -96,6 +96,13 @@ const STRINGS = { 'remove.title': 'Remove torrent?', 'remove.deleteFiles': 'Also delete its downloaded files', 'remove.ok': 'Remove', + 'remove.titleMany': 'Remove {count} torrents?', + 'remove.deleteFilesMany': 'Also delete their downloaded files', + + 'bulk.selectAll': 'Select all', + 'bulk.selectOne': 'Select {name}', + 'bulk.selected': '{count} selected', + 'bulk.remove': 'Remove selected', 'share.titleOne': 'Share this publicly?', 'share.titleMany': 'Share these {count} publicly?', @@ -373,6 +380,13 @@ const STRINGS = { 'remove.title': 'حذف التورنت؟', 'remove.deleteFiles': 'احذف ملفاته المنزّلة أيضًا', 'remove.ok': 'حذف', + 'remove.titleMany': 'حذف {count} من التورنتات؟', + 'remove.deleteFilesMany': 'احذف ملفاتها المنزّلة أيضًا', + + 'bulk.selectAll': 'تحديد الكل', + 'bulk.selectOne': 'تحديد {name}', + 'bulk.selected': 'المحدد: {count}', + 'bulk.remove': 'حذف المحدد', 'share.titleOne': 'مشاركة هذا للجميع؟', 'share.titleMany': 'مشاركة هذه الـ {count} للجميع؟', diff --git a/ui/style.css b/ui/style.css index 3403033..e311925 100644 --- a/ui/style.css +++ b/ui/style.css @@ -657,6 +657,24 @@ textarea.input { * TORRENTS */ +.bulk-bar { + display: flex; + align-items: center; + gap: 12px; + min-height: 32px; + margin-bottom: 10px; + padding-inline-start: 17px; +} + +.bulk-bar .check-row { + margin-inline-end: auto; +} + +.bulk-bar .count { + font-size: 13px; + color: var(--text-3); +} + .torrent-list { list-style: none; margin: 0; From 09b8c0d3ba12b6f2a6a6d14b6fee65799ad9b9af Mon Sep 17 00:00:00 2001 From: GENERAL868 <212038781+GENERAL868@users.noreply.github.com> Date: Tue, 10 Nov 2026 00:04:11 +0400 Subject: [PATCH 4/4] Keep the removal list from scrolling sideways --- ui/app.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ui/app.js b/ui/app.js index 7ac5710..d652842 100644 --- a/ui/app.js +++ b/ui/app.js @@ -1090,7 +1090,7 @@ function renderModal () { .filter((x) => m.torrents.includes(x.id)) .map((x) => `
  • ${esc(x.name || '…')}
  • `).join('') body = `

    ${tt('remove.titleMany', { count: m.torrents.length })}

    -
      ${names}
    +
      ${names}