Skip to content

feat: optimize torrent list API with lightweight status and filtering#693

Open
staners2 wants to merge 1 commit intoYouROK:masterfrom
staners2:feat/optimize-torrent-list
Open

feat: optimize torrent list API with lightweight status and filtering#693
staners2 wants to merge 1 commit intoYouROK:masterfrom
staners2:feat/optimize-torrent-list

Conversation

@staners2
Copy link
Copy Markdown

@staners2 staners2 commented Apr 9, 2026

Optimize /torrents action:"list" endpoint for servers with large number of torrents.

Problem: with 100+ torrents the list request hangs — Status() is called for each torrent,
performing file listing, sorting, TorrsHash generation and detailed byte/chunk statistics.

Changes:

  • StatusLight() — lightweight status without FileStats, TorrsHash and detailed statistics
  • Filter field in list request: "all" (default), "active" (in-memory only), "last" (most recent by timestamp)
  • 2-second response cache for list to reduce load from frequent polling

Full status with files is still available via action:"get" by hash.

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