Skip to content

feat: Add torrent favorites/collection management#1081

Draft
Copilot wants to merge 3 commits intomasterfrom
copilot/add-favorites-collection-feature
Draft

feat: Add torrent favorites/collection management#1081
Copilot wants to merge 3 commits intomasterfrom
copilot/add-favorites-collection-feature

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 9, 2026

Implements a full torrent bookmarks system: users can organize torrents into named collections, manage those collections, and bookmark torrents from search results or PT site pages.

Data Model

  • ICollectionFolder — folder metadata (id, name, color, sortIndex, isDefault, torrentIds[])
  • TTorrentCollectionKey — composite site:id string for global torrent uniqueness
  • Folder metadata lives in IMetadataPiniaStorageSchema.collections; full torrent objects in a separate collectionTorrents key in IExtensionStorageSchema (avoids bloating pinia state with large torrent payloads)
  • A default non-deletable collection always exists (DEFAULT_COLLECTION_ID = "default")
export function buildTorrentCollectionKey(torrent: Pick<ITorrent, "site" | "id">): TTorrentCollectionKey {
  return `${torrent.site}:${torrent.id}`;
}

Metadata Store

New getters: isTorrentCollected, getSortedCollections, getCustomCollections, getTorrentCollectionIds

New actions:

  • addCollection / editCollection / removeCollection — removing a folder does not delete its torrents
  • addTorrentToCollections / addTorrentsToCollections (batch, single IO) / updateTorrentCollections / removeTorrentFromAllCollections — removing a torrent purges it from all folders and extStorage

UI Changes

/my-collection Page (Overview)

  • Left panel: folder list with add/edit/delete; default folder is non-deletable
  • Right panel: torrent table per selected folder with filter, multi-select, and remove

Bookmark Button Logic (shared)

  • No custom collections → direct add/remove from default collection
  • Custom collections exist → opens CollectionAddDialog showing a checklist pre-populated with the torrent's current folders

Integration Points

  • ActionTd.vue (SearchEntity) — bookmark button appears on single-torrent rows
  • SiteDetailPage.vue (content-script) — bookmark SpeedDial button for the detail page torrent
  • SiteListPage.vue (content-script) — batch bookmark button for all parsed torrents on the page; uses addTorrentsToCollections to avoid per-torrent storage round-trips

✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI and others added 2 commits March 9, 2026 15:36
Co-authored-by: Rhilip <13842140+Rhilip@users.noreply.github.com>
…selections

Co-authored-by: Rhilip <13842140+Rhilip@users.noreply.github.com>
Copilot AI changed the title [WIP] Add favorite seed collection feature feat: Add torrent favorites/collection management Mar 9, 2026
@Rhilip Rhilip linked an issue Mar 30, 2026 that may be closed by this pull request
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