Skip to content

remove forced Trakt metadata source - #4

Merged
neckaros merged 3 commits into
masterfrom
t3code/remove-trakt-forced-source
Aug 8, 2026
Merged

remove forced Trakt metadata source#4
neckaros merged 3 commits into
masterfrom
t3code/remove-trakt-forced-source

Conversation

@neckaros

@neckaros neckaros commented Aug 8, 2026

Copy link
Copy Markdown
Owner

Summary

  • Remove forced Trakt metadata-source behavior.
  • Canonicalize movie, series, and episode history IDs and migrate existing watch progress.
  • Add a Trakt remapping script with backups, mapping reports, and unresolved-item tracking.
  • Preserve external IDs during episode metadata refreshes.

Testing

  • Not run.

- Map watched episode and movie entries to stable IDs
- Preserve backups, CSV mappings, unresolved records, and a JSON report
@neckaros

neckaros commented Aug 8, 2026

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Security Review

Here are some automated security review suggestions for this pull request.

Reviewed commit: 6eb445f788

View security finding report

Only the user who started this review can view the report in Codex.

ℹ️ About Codex security reviews in GitHub

This is an experimental Codex feature. Security reviews are triggered when:

  • You comment "@codex security review"
  • A regular code review gets triggered (for example, "@codex review" or when a PR is opened), and you’re opted in so security review runs alongside code review

Once complete, Codex will leave suggestions, or a comment if no findings are found.

Comment thread src/model/history.rs Outdated

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 6eb445f788

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/model/history.rs Outdated
Comment thread src/model/store/sql/users.rs
Comment thread src/model/mod.rs
Comment thread src/model/movies.rs Outdated
Comment thread src/model/store/sql/users.rs Outdated
Comment thread src/routes/movies.rs
Comment thread scripts/remap_trakt_watched.py
@neckaros

neckaros commented Aug 8, 2026

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Security Review

Here are some automated security review suggestions for this pull request.

Reviewed commit: 44d57b5f93

View security finding report

Only the user who started this review can view the report in Codex.

ℹ️ About Codex security reviews in GitHub

This is an experimental Codex feature. Security reviews are triggered when:

  • You comment "@codex security review"
  • A regular code review gets triggered (for example, "@codex review" or when a PR is opened), and you’re opted in so security review runs alongside code review

Once complete, Codex will leave suggestions, or a comment if no findings are found.

Comment thread src/model/movies.rs
Comment on lines +396 to +397
self.migrate_movie_history_id(old_history_id, movie_history_id(&movie))
.await?;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Security: Scope history rewrites to the authenticated library

Requires a bearer-authenticated Admin of one movie library, a known IMDb ID present in another user's history, and permission to edit that library's movie. Changing the movie's imdb field calls migrate_movie_history_id, which scans the server-global watched/progress tables and rewrites every user's matching rows. Thus a library-scoped admin can retarget unrelated users' watched state and playback progress to an attacker-selected movie. Limit online rewrites to explicitly authorized users, or reserve cross-user migration for a server-admin operation.

Useful? React with 👍 / 👎.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 44d57b5f93

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/model/history.rs
Comment on lines +280 to +284
.apply_history_rewrites(watched_rewrites, progress_rewrites)
.await?;
self.store
.complete_data_migration(HISTORY_MIGRATION)
.await?;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Commit the rewrite and migration marker atomically

If the process exits or complete_data_migration fails after apply_history_rewrites commits, the next startup retries the migration using the old rows that the first pass converted to tombstones. Because that tombstone update runs after the canonical insert and the triggers refresh modified, source_modified >= existing_modified selects date = 0 on the retry and silently clears the canonical watched state. Write the completion marker in the same transaction as the rewrites, or make retries ignore tombstones created by a completed rewrite.

AGENTS.md reference: AGENTS.md:L77-L79

Useful? React with 👍 / 👎.

Comment on lines +336 to +339
backup_path = server_db.with_name(
f"{server_db.name}.bak-{time.strftime('%Y%m%d-%H%M%S')}"
)
shutil.copy2(server_db, backup_path)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Create the recovery backup through SQLite

When this recovery script is run while the server is still active, which the CLI neither prevents nor warns against, shutil.copy2 reads the database file without acquiring a SQLite read lock. A concurrent write or checkpoint can therefore leave this sole rollback artifact inconsistent or missing journal/WAL state before the script destructively rewrites history. Use SQLite's online backup API (or require and verify server shutdown) rather than copying the live database file directly.

Useful? React with 👍 / 👎.

@neckaros
neckaros merged commit 2b3d156 into master Aug 8, 2026
1 check passed
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.

1 participant