remove forced Trakt metadata source - #4
Conversation
- Map watched episode and movie entries to stable IDs - Preserve backups, CSV mappings, unresolved records, and a JSON report
|
@codex review |
There was a problem hiding this comment.
💡 Codex Security Review
Here are some automated security review suggestions for this pull request.
Reviewed commit: 6eb445f788
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.
There was a problem hiding this comment.
💡 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".
|
@codex review |
There was a problem hiding this comment.
💡 Codex Security Review
Here are some automated security review suggestions for this pull request.
Reviewed commit: 44d57b5f93
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.
| self.migrate_movie_history_id(old_history_id, movie_history_id(&movie)) | ||
| .await?; |
There was a problem hiding this comment.
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 👍 / 👎.
There was a problem hiding this comment.
💡 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".
| .apply_history_rewrites(watched_rewrites, progress_rewrites) | ||
| .await?; | ||
| self.store | ||
| .complete_data_migration(HISTORY_MIGRATION) | ||
| .await?; |
There was a problem hiding this comment.
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 👍 / 👎.
| 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) |
There was a problem hiding this comment.
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 👍 / 👎.
Summary
Testing