Skip to content

Add Trakt ZIP export imports - #1817

Merged
IgnisDa merged 4 commits into
mainfrom
issue-1816-trakt-export
Aug 22, 2026
Merged

Add Trakt ZIP export imports#1817
IgnisDa merged 4 commits into
mainfrom
issue-1816-trakt-export

Conversation

@IgnisDa

@IgnisDa IgnisDa commented Aug 21, 2026

Copy link
Copy Markdown
Owner

Summary

  • add a third Trakt import mode for account export ZIP files while preserving username and public-list imports
  • import watch history, ratings, comments, Owned items, Watchlist, Favorites, and custom lists without requiring a Trakt client ID
  • validate archive structure and decompressed sizes, order paginated files numerically, and ignore aggregate watched files
  • add the Export ZIP frontend form and document setup, supported data, and API credential requirements

Validation

  • cargo test --package trakt-importer-service
  • cargo clippy --package trakt-importer-service --all-targets
  • cargo fmt --all -- --check
  • yarn turbo run build --filter=@ryot/frontend
  • yarn turbo run typecheck --filter=@ryot/frontend
  • yarn turbo run build --filter=@ryot/docs
  • GraphQL code generation

Closes #1816

Summary by CodeRabbit

  • New Features

    • Added support for importing Trakt Export ZIP files.
    • Added an “Export ZIP” option with required ZIP file upload.
    • ZIP imports now support watch history, ratings, comments, collections, watchlists, favorites, and custom lists.
    • Added validation and clear handling for invalid or incomplete export files.
  • Documentation

    • Clarified which Trakt import methods require a client ID.
    • Added setup and usage guidance for ZIP export imports.

Parse official Trakt export archives locally so imports no longer depend on API access or a client ID. Preserve the existing username and public-list paths while sharing their media conversion behavior.

Import watch history, ratings, comments, owned media, system lists, and custom lists. Validate archive structure and decompressed sizes, ignore aggregate watch files, and cover pagination, malformed input, target coordinates, and collections with focused unit tests.
Expose a third Trakt import mode that uploads the account export ZIP through the existing temporary file pipeline. Keep username and public-list forms available and submit the generated export path through the new GraphQL input variant.
Describe how to request and upload a Trakt account export and list the imported data categories. Clarify throughout the user and generated configuration documentation that only API-based username and public-list imports require a Trakt client ID.
@coderabbitai

coderabbitai Bot commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: d17169c4-dcb1-4f0f-8579-e47c4f911c42

📥 Commits

Reviewing files that changed from the base of the PR and between 6c4d778 and ce72fd0.

⛔ Files ignored due to path filters (2)
  • Cargo.lock is excluded by !**/*.lock
  • libs/generated/src/graphql/backend/graphql.ts is excluded by !**/generated/**
📒 Files selected for processing (11)
  • apps/docs/src/configuration.md
  • apps/docs/src/guides/trakt.md
  • apps/docs/src/importing/trakt.md
  • apps/docs/src/includes/backend-config-schema.yaml
  • apps/frontend/app/routes/_dashboard.settings.imports-and-exports._index.tsx
  • crates/config/definition/src/lib.rs
  • crates/models/media/src/import_export.rs
  • crates/services/importer/trakt/Cargo.toml
  • crates/services/importer/trakt/src/export.rs
  • crates/services/importer/trakt/src/lib.rs
  • crates/services/importer/trakt/src/tests.rs

Included review availability: Your plan provides up to 8 included reviews per hour; 6 remain after this review.


Walkthrough

Trakt imports now support Export ZIP files. The frontend submits ZIP paths through a new import variant. The importer parses supported JSON entries, imports history, ratings, comments, and collections, enforces decompression limits, and documents API and ZIP requirements.

Changes

Trakt ZIP export import

Layer / File(s) Summary
ZIP import input contract
crates/models/media/import_export.rs, apps/frontend/app/routes/...
The import model and frontend now support an Export ZIP tab with a required ZIP upload.
Importer dispatch and shared parsing
crates/services/importer/trakt/Cargo.toml, crates/services/importer/trakt/src/lib.rs
Trakt export inputs route to the ZIP importer. Shared response models and show-coordinate extraction support export processing.
ZIP archive processing
crates/services/importer/trakt/src/export.rs
The importer recognizes supported files, orders pages, enforces decompression limits, parses JSON, and creates history, ratings, comments, and collection results.
Validation and usage documentation
crates/services/importer/trakt/src/tests.rs, apps/docs/src/..., crates/config/...
Tests cover archive parsing, supported records, invalid input, limits, and missing identifiers. Documentation clarifies API client ID requirements and ZIP import behavior.

Estimated code review effort: 4 (Complex) | ~45 minutes

Merge Risk: ⚪ Minimal · up to ce72f

This change adds Trakt export ZIP importing while preserving existing import modes; no actionable merge-blocking risk remains after normal checks and review.

Sequence Diagram(s)

sequenceDiagram
  participant SettingsUI
  participant ImportInput
  participant TraktImporter
  participant ExportImporter
  participant ZipArchive
  SettingsUI->>ImportInput: submit Export ZIP path
  ImportInput->>TraktImporter: send Export input
  TraktImporter->>ExportImporter: dispatch ZIP import
  ExportImporter->>ZipArchive: read recognized JSON entries
  ZipArchive-->>ExportImporter: return parsed records
  ExportImporter-->>TraktImporter: return ImportResult
Loading
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 18.42% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 38 functions across 6 files. (5 skipped: 5 unsupported.) Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: adding Trakt ZIP export imports.
Linked Issues check ✅ Passed The changes implement Trakt export ZIP imports, including upload support, parsing, supported data types, validation, and focused tests.
Out of Scope Changes check ✅ Passed The documentation, frontend, model, importer, and test changes directly support the Trakt ZIP export import objective.
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch issue-1816-trakt-export

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 Clippy (1.97.1)

Clippy execution timed out


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@IgnisDa
IgnisDa merged commit 8cb503e into main Aug 22, 2026
15 checks passed
@IgnisDa
IgnisDa deleted the issue-1816-trakt-export branch August 22, 2026 17:29
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.

Import a Trakt Exported file

1 participant