chore: sync upstream/master (6 commits) #250
No reviewers
Labels
No labels
bug
dependencies
documentation
duplicate
enhancement
good first issue
help wanted
invalid
javascript
python
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
djangonux/Upload-Assistant!250
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "sync/upstream-merge"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Upstream changes included
readme: development freeze notice + upbrr linkfix(edition): ignore sole IMDb edition (imdb_edition_count > 1guard)fix(tvdb): don't rely on slug — use_series_translation_metadata/_translated_series_namePTP: fix poster rehosting (rehost_poster_to_selected_host)fix(trackers/IS): successful upload detectionNBL: fix ignoredupes ('1'instead of'on')Conflict resolution
README.mdsrc/edition.pysrc/imdb.pyedition_countfield)src/metadata_searching.py_apply_tvdb_series_metadata)src/prep.pysrc/trackers/NBL.pysrc/trackers/PTP.pysrc/tvdb.py🤖 Generated with Claude Code
Summary by CodeRabbit
New Features
Bug Fixes
Documentation
📝 Walkthrough
Walkthrough
The PR centralizes TVDB English title/year resolution into translation-driven helpers, adds
edition_countto IMDb info to gate duration-based edition matching, extendsCookieAuthUploaderwith asuccess_listparameter, overhauls PTP poster handling with a pluggable rehosting pipeline, and adjustsPrepcategory/title/audio logic. NBL gets a minorignoredupesfix and raw-disc check reordering.Changes
TVDB/IMDb Metadata Pipeline Refactor
src/imdb.py,src/edition.py,tests/test_edition.pyImdbManagersetsedition_count = len(edition_list)on the returned dict;get_editionconverts it defensively toint, gates the duration-match path onedition_count > 1, and corrects the third return element's type annotation fromstrtobool; the test fixture addsedition_count=2.src/tvdb.pyYEAR_PATTERNconstant and replaces slug/alias selection with a_series_translation_metadatapipeline: helpers for building English alias lists, extracting years from text, and best-effort year from series info; allget_tvdb_by_external_idseries-name return paths switch to_translated_series_name._apply_tvdb_series_metadatahelper and call-site migrationsrc/metadata_searching.py_apply_tvdb_series_metadatato settvdb_series_nameand derivetvdb_series_year/search_yearfromepisodes_datawith early return for English originals; replaces inline assignments acrossall_ids,imdb_tmdb_tvdb,imdb_tvdb,get_tv_data(both paths), andget_tvdb_tvmaze_tmdb_episode_data.Upload Success & PTP Poster Rehosting
success_listand IS tracker usagesrc/cookie_auth.py,src/trackers/IS.pyhandle_uploadandhandle_failed_uploadgain an optionalsuccess_listparameter; validation and response-predicate logic extended to match any list entry;IS.uploadswitches fromsuccess_texttosuccess_listwith two accepted success strings.src/trackers/PTP.pycontextlibimport; introduces_selected_poster_host,_poster_already_on_selected_host,_poster_extension, andrehost_poster_to_selected_hostmethods; expired-session handling deletes the cookie file viacontextlib.suppress(OSError); upload cover acquisition uses the new rehosting pipeline with a user-prompt loop enforcing allowed image extensions.ignoredupesvalue and raw-disc check orderingsrc/trackers/NBL.pyignoredupespayload value from"on"to"1"; raw-disc early-exit insearch_existingis moved to run after language andvalid_michecks.Prep Metadata Handling
src/prep.py_title_without_leading_articleand_tvdb_title_drops_existing_leading_articlehelpers;gather_prepderives category viaget_cator uppercases existing value withoutmanual_category; removesakasimilarity-suppression block; TVDB series name overwrite is now conditional on the leading-article heuristic;get_audio_v2unpacked to 3 values droppinghas_audiodesc; episode regex patterns loosened and multi-file TV-pack detection removed fromget_cat.Estimated code review effort
🎯 4 (Complex) | ⏱️ ~60 minutes
Possibly related PRs
src/edition.py'sget_editionlogic—this PR adjusts edition-count gating and fixes the return type, while the retrieved PR adds normalization to preserve "Special Edition" formatting.src/trackers/IS.py's upload success handling viaCookieAuthUploader, with this PR extending the mechanism to support multiple success strings viasuccess_list.SequenceMatcher-basedmeta["aka"]suppression block insrc/prep.pythat the retrieved PR introduced, making them directly conflicting changes.🚥 Pre-merge checks | ✅ 4 | ❌ 1
❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings.
✨ Finishing Touches
🧪 Generate unit tests (beta)
sync/upstream-mergeThanks 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 helpto get the list of available commands and usage tips.@coderabbitai review
✅ Action performed
Review finished.
Actionable comments posted: 4
🧹 Nitpick comments (2)
🤖 Prompt for all review comments with AI agents
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID:
40c6a164-026b-4f21-9c8b-f048a910c0b8📥 Commits
Reviewing files that changed from the base of the PR and between
2e55153a8dand9e52a8b5c3.📒 Files selected for processing (11)
README.mdsrc/cookie_auth.pysrc/edition.pysrc/imdb.pysrc/metadata_searching.pysrc/prep.pysrc/trackers/IS.pysrc/trackers/NBL.pysrc/trackers/PTP.pysrc/tvdb.pytests/test_edition.py⚠️ Potential issue | 🟡 Minor
🧩 Analysis chain
🏁 Script executed:
Repository: yippee0903/Upload-Assistant
Length of output: 2678
🏁 Script executed:
Repository: yippee0903/Upload-Assistant
Length of output: 193
🏁 Script executed:
Repository: yippee0903/Upload-Assistant
Length of output: 2905
Fix the return type annotation to match the actual implementation.
The third return value is always a string (
"","Hybrid", or"Custom"), not abool. The annotation at line 19 should betuple[str, str, str].Proposed fix
📝 Committable suggestion
🤖 Prompt for AI Agents
✅ Addressed in commit
b1e631e@ -18,6 +18,23 @@ def _coerce_int(value: Any) -> Optional[int]:return None⚠️ Potential issue | 🟠 Major
🧩 Analysis chain
🏁 Script executed:
Repository: yippee0903/Upload-Assistant
Length of output: 11930
Fix TVDB year handling: include the year in
tvdb_series_nameor update all consumers to checktvdb_series_year.The change separates
tvdb_series_yearinto its own field, but downstream code (LST.py and prep.py) still infers year presence by regex-matching againsttvdb_series_name. When TVDB returnsseries_title="Shameless"andseries_year="2011", the code now setstvdb_series_name="Shameless"(no year) andtvdb_series_year="2011"(separate). LST then sees no year in the name string and strips it—even though TVDB provided one. Test cases explicitly expect the year to be present in thetvdb_series_namestring (e.g.,tvdb_series_name="Shameless (2011)") for year-retention logic to work.Options:
tvdb_series_namewhen available (e.g.,"Shameless (2011)")LST.py(lines 165–168) andprep.py(lines 1116–1128) to checktvdb_series_yearin addition to or instead of string inspection🤖 Prompt for AI Agents
✅ Addressed in commit
b1e631e⚠️ Potential issue | 🔴 Critical
🧩 Analysis chain
🏁 Script executed:
Repository: yippee0903/Upload-Assistant
Length of output: 19029
Return value count mismatch causes runtime
ValueError.The code unpacks 3 values from
get_audio_v2, but the function returns a 4-tuple(str, str, bool, bool)persrc/audio.py:127-133. This will raiseValueError: too many values to unpack (expected 3)at runtime, breaking all uploads.🐛 Proposed fix to unpack all 4 values
📝 Committable suggestion
🤖 Prompt for AI Agents
✅ Addressed in commit
b1e631e⚠️ Potential issue | 🟡 Minor | ⚡ Quick win
Extract the year from the selected translation title before falling back.
Line 114 may choose a title like
Foo (2020), but lines 116-121 never inspect that title. When aliases are empty or lack a year,series_yearstays unset and callers cannot populatetvdb_series_year/search_year.Proposed fix
🤖 Prompt for AI Agents
✅ Addressed in commit
b1e631e