Repository navigation
fix(filebot): reject wrong-year movie matches and email unprocessed downloads - #217
Merged
Merged
Conversation
added 2 commits
October 16, 2026 11:13
…ownloads Non-strict TheMovieDB matched "Around.The.World.In.80.Days.1989.Part1.avi" to the 1988 animated film after strict auto-detection had refused it, and moved the 1989 miniseries into Movies under the wrong title. Year guard: before TheMovieDB or OMDb move anything, dry-run the match and compare each destination's (YYYY) with the years in the source filename (or its folder). The preview runs the same check. On a mismatch nothing moves, the database chain stops, and a YEAR MISMATCH line classifies the download as no-match, ahead of any conflict line, so a wrong-title duplicate never reaches media-compare. Exact match only: a one-year tolerance would not have caught 1989 -> 1988. TV databases are not guarded. Email: when a download is triaged as no-match or failed, send one email to alerts.email (config.yml) through alert-lib.sh, naming the torrent, the triage folder and the reason. already-in-plex sends nothing. The setup script writes alerts.email from MONITORING_EMAIL in config.conf. Closes #216
Review findings on the year guard and alert email: - A TheMovieDB/OMDb dry run with no match lines (a TMDB error, say) let the real move run unchecked. Now nothing moves. - The torrent name goes into the Subject header; CR/LF in it could add headers. Replace them with spaces. - Two grep pipelines without a match failed under errexit; add || true. Tests: an empty dry run moves nothing, header injection, and exactly one email per triaged download. Three plumbing tests that used TheMovieDB with the empty-output FileBot mock now use TheTVDB, which has no guard. Advances #216
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #216: non-strict TheMovieDB filed the 1989 NBC miniseries Around the World in 80 Days as the 1988 animated film after strict auto-detection had refused it.
Year guard. Before TheMovieDB or OMDb move anything,
process_with_databasedry-runs the match.filebot_year_mismatchcompares each destination's(YYYY)with the years in the source filename (or its folder name). The preview runs the same check. On a mismatch:filebot_chain_should_stop)YEAR MISMATCH:line makesclassify_failurereturnno-match, ahead of any conflict line, so a wrong-title duplicate never reaches media-compareExact match only. A one-year tolerance would not have caught 1989 → 1988, so a correct match whose TMDB year is one off the release name now goes to triage with an email. A filename with no year is not checked, and TV databases are not guarded.
Email. A download triaged as
no-matchorfailedsends one email toalerts.emailfromconfig.yml, throughalert-lib.sh. It names the torrent, the triage folder and the reason.already-in-plexsends nothing. The email goes out after the triage move, so watcher retries do not resend it. CR/LF in the torrent name are stripped from the subject.transmission-filebot-setup.shwritesalerts.emailfromMONITORING_EMAIL.Deployment
Live
transmission-doneis a symlink into the main checkout, so the code goes live when main is pulled there. No email is sent until the liveconfig.ymlhas analerts.emailkey. It is not there today. Add it by hand or re-run setup.Testing
Review notes
The pre-push review warned that
dry_run=$(run_filebot ...)could abort under errexit. The script runsset -uo pipefailwithout-e(line 25), and the real-run assignment next to it uses the same pattern, so no change was made.