Skip to content

WebAPI: Allow seeding lifetime stats on torrent add#24326

Open
jabloink wants to merge 5 commits into
qbittorrent:masterfrom
jabloink:feat-seed-stats-on-add
Open

WebAPI: Allow seeding lifetime stats on torrent add#24326
jabloink wants to merge 5 commits into
qbittorrent:masterfrom
jabloink:feat-seed-stats-on-add

Conversation

@jabloink

Copy link
Copy Markdown

what it does

adds an optional stats json object to POST /api/v2/torrents/add that populates the lifetime stat fields in lt::add_torrent_params

  • total_uploaded
  • total_downloaded
  • added_time
  • completed_time
  • last_seen_complete
  • last_upload
  • last_download
  • active_time
  • finished_time
  • seeding_time

these are the same fields libtorrents read_resume_data() writes to when loading a .fastresume file on session startup, just exposed through the api, tracker announces are unaffected since libtorrents announce uses a separate session counter that always starts at zero and omitting stats produces identical behavior to today

motivation

migrating torrents between qbit instances or from other clients currently requires editing resume data files and restarting qbit to load them, this routes the same data through libtorrents existing fields via the api so external tooling can carry history across without restarting

@glassez glassez changed the title WebAPI: allow seeding lifetime stats on torrent add WebAPI: Allow seeding lifetime stats on torrent add May 22, 2026
Comment thread src/base/bittorrent/addtorrentparams.h Outdated
@glassez glassez added WebAPI WebAPI-related issues/changes Feature Implement new feature/subsystem labels May 22, 2026
@jabloink
jabloink force-pushed the feat-seed-stats-on-add branch 3 times, most recently from e498802 to 487551b Compare May 28, 2026 14:56
@sk0mik

sk0mik commented Jul 14, 2026

Copy link
Copy Markdown

@jabloink conflicts

@jabloink
jabloink force-pushed the feat-seed-stats-on-add branch from 487551b to 52af267 Compare July 14, 2026 12:19
@jabloink

Copy link
Copy Markdown
Author

@sk0mik thanks, updated

@jabloink
jabloink requested a review from glassez July 15, 2026 03:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Feature Implement new feature/subsystem WebAPI WebAPI-related issues/changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants