Skip to content

fix(collections): repair broken builtin collection templates - #331

Merged
Quick104 merged 2 commits into
mainfrom
claude/determined-moore-ee1757
Jul 7, 2026
Merged

Quick104 merged 2 commits into
mainfrom
claude/determined-moore-ee1757

Conversation

@Quick104

@Quick104 Quick104 commented Jul 7, 2026 •

Copy link
Copy Markdown
Contributor

Problem

A full audit of the builtin collection-template catalog (every one of the 40 MDBList URLs and all 10 TMDB franchise collection IDs fetched live) found:

  1. Two dead sources. mdblist_misc_a24 (irvingbeano/a24) and mdblist_misc_criterion_collection (shtluck/the-complete-criterion-collection) were deleted on MDBList and return 404 — every sync of those collections fails. Both ship in the studio_collections and all_defaults bundles.
  2. A silent bundle-apply collision. mdblist_charts_popular_movies and tmdb_popular_movies both slugify to popular-movies. Bundle apply dedupes by slugified title per library (slug-match adoption in applyTemplateBundle), so applying all_defaults always silently skipped the MovieMeter template — and dry-run previewed would_create for both, diverging from the real apply.
  3. Defaults contradicting descriptions. All templates shipped DefaultLimit: 50, and sync scans at most limit × 4 source entries — so "IMDb Top 250" never even scanned entries 201–250, and "The complete Criterion Collection" considered only the first 200 of ~1,000 entries.
  4. Metadata errors. IFC Films was MediaMixed but its live list is 100% movies (as mixed it was offered to TV-only libraries where it always synced empty); Trakt Popular descriptions claimed "all-time most-watched" but Trakt's popular endpoint is ratings-based.

Changes

  • Repoint A24 → inshanemagic/a24-films (146 movies) and Criterion → reptauros/the-criterion-collection (1,000 movies); both verified live with correct media types. Criterion's description no longer claims "complete".
  • Retitle the MovieMeter template to "IMDb MovieMeter Top 100" (fixes the slug collision), regenerate its poster from the text-free raw plate per the documented typography workflow, and add TestBuiltinTemplateTitleSlugsAreUnique so builtin title slugs can never collide again.
  • Raise the shared default limit 50 → 100; explicit 250 for the IMDb Top 250 pair; no limit for catalog lists (Criterion, A24) so they hold every owned title. TestBuiltinTemplateDefaultLimits encodes the override scheme.
  • IFC Films → MediaMovie; Trakt Popular descriptions corrected; stale limit docs in docs/wiki/admin/collection-templates.md fixed (they claimed a 20/50 split that never matched the code).

Template IDs are unchanged, so poster assets, bundle references, and existing management keys are unaffected.

Verification

  • All 40 MDBList URLs fetched live: 38 healthy, the 2 repointed ones verified (item counts + media-type mix match each template's MediaKind).
  • All 10 TMDB franchise collection IDs resolve to the expected collections on TMDB.
  • go vet + full internal/collections/templates and internal/api/handlers test suites pass; gofmt clean; go build ./internal/... clean.
  • Sync-path trace confirmed every builtin source/preset combination (TMDB presets incl. trending all, Trakt presets incl. profile-gated recommended, Discover incl. certification_lte with certification_country=US, franchise placeholder CollectionID=0, MDBList) is handled end-to-end at sync time.

Risks / follow-up

  • Repointing only affects newly created collections: servers that already applied the studio bundle keep the dead URL in existing collections' source_config and need a re-apply with delete-existing (or a manual source edit). Syncs fail loudly in the meantime, as before.
  • MDBList lists are community-owned; a periodic liveness check of template URLs would catch future deletions before users do (not included here).

No linked issue — defect found and fixed during a catalog audit of this session.

AI-use disclosure

Authored by Claude Code (Claude Fable 5) under human direction; external URL/ID verification performed against live MDBList and TMDB.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Documentation

    • Updated the built-in collection template docs to reflect a new default item limit of 100, with special cases for larger canonical lists.
    • Clarified several template descriptions and list behaviors for better accuracy.
  • Bug Fixes

    • Corrected default limits for select built-in templates, including top-ranked lists and catalog-style lists with no cap.
    • Improved consistency by ensuring built-in template titles remain uniquely slugable.

A live audit of the builtin template catalog (all 40 MDBList URLs and all
10 TMDB franchise IDs fetched) found two dead sources, a silent bundle-apply
collision, and several templates whose defaults contradict their descriptions:

- Repoint mdblist_misc_a24 and mdblist_misc_criterion_collection to live
  lists; the original irvingbeano/shtluck lists were deleted on MDBList
  (404), so every sync of those collections failed.
- Retitle mdblist_charts_popular_movies to "IMDb MovieMeter Top 100". It
  shared the "popular-movies" title slug with tmdb_popular_movies, and
  bundle apply dedupes by slug per library, so applying all_defaults
  silently skipped it. Poster regenerated from the raw plate with the new
  title; new handler test asserts builtin title slugs stay unique.
- Raise the shared default limit 50 -> 100, give the IMDb Top 250 templates
  an explicit 250 (limit*4 fetch trim previously never scanned entries
  201-250), and drop the limit on catalog lists (Criterion, A24) so they
  hold every owned title.
- Correct IFC Films to MediaMovie (live list is 100% movies; as MediaMixed
  it was offered to TV libraries where it always synced empty) and fix the
  Trakt Popular descriptions (ratings-based, not "most-watched").
- Update stale limit docs in collection-templates.md.

Co-Authored-By: Claude Fable 5 <[email protected]>
@coderabbitai

coderabbitai Bot commented Jul 7, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

Warning

Review limit reached

You’ve reached a temporary PR review limit under our Fair Usage Limits Policy.

Your recent review volume is higher than typical usage, so adaptive limits are currently applied.

Next review available in: 24 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 63cac18b-7c79-4493-86f5-ecb1d688fdf2

📥 Commits

Reviewing files that changed from the base of the PR and between 97bb355 and d14d065.

📒 Files selected for processing (6)
  • internal/api/handlers/user_collection_imports.go
  • internal/collectionutil/collectionutil.go
  • web/src/components/CollectionTemplateGallery/CollectionTemplateConfigForm.tsx
  • web/src/components/CollectionTemplateGallery/UserCollectionTemplateConfigForm.tsx
  • web/src/lib/collectionTemplates.ts
  • web/src/pages/adminCollectionsShared.tsx
📝 Walkthrough

Walkthrough

This PR raises the shared builtin collection template default item limit from 50 to 100, adds explicit DefaultLimit overrides for IMDb Top 250 and select catalog templates, updates several template descriptions/titles/MediaKind, adds a slug-uniqueness test, updates the default-limit test, and updates documentation.

Changes

Collection Template Default Limit Update

Layer / File(s) Summary
Shared default limit constant and overrides
internal/collections/templates/builtin.go
builtinDefaultLimit raised from 50 to 100; IMDb Top 250 movies/shows set to explicit 250; Criterion Collection and A24 set to 0 (uncapped catalog).
Template description and title updates
internal/collections/templates/builtin.go
Trakt popular movies/shows description wording updated; MDBList charts template title/comment reworked to "IMDb MovieMeter Top 100"; IFC Films changed from mixed to movies-only MediaKind.
Tests and documentation
internal/collections/templates/templates_test.go, internal/api/handlers/collection_templates_test.go, docs/wiki/admin/collection-templates.md
Default-limit test reworked to allow per-template overrides; new test asserts builtin template title slugs are unique; docs updated to describe the unified 100-item default and overrides.

Estimated code review effort: 2 (Simple) | ~15 minutes

Related PRs: None identified in this diff context.

Suggested labels: enhancement, documentation, tests

Suggested reviewers: None identified.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main change: repairing broken builtin collection templates.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch claude/determined-moore-ee1757

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

@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: 97bb3554e7

ℹ️ About Codex in GitHub

Codex has been enabled to automatically 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 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Source: SourceMDBList,
MediaKind: MediaMovie,
DefaultLimit: builtinDefaultLimit,
DefaultLimit: 250,

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 Keep IMDb defaults within import limit caps

When this catalog is served to the direct template galleries, the limit input is initialized from default_limit, but both CollectionTemplateConfigForm and UserCollectionTemplateConfigForm still render that field with max={200}, and the user import API rejects limits above 200. Selecting the IMDb Top 250 template and submitting with this new default 250 therefore either fails native form validation or gets a 400, so direct creation is broken unless the user manually lowers the limit and loses the Top 250 behavior; raise those caps with this change or avoid sending an over-cap default to those forms.

Useful? React with 👍 / 👎.

The IMDb Top 250 templates now default to 250 items, but the template
config forms rendered their Max Items input with max=200 and the user
import API rejected limits above 200, so applying those templates from
the direct galleries failed native validation or got a 400.

Raise the cap to 500 on both sides, wired to shared constants: sync's
fetch trim (collectionSourceFetchMax) never scans more than 500 source
entries, so a larger explicit limit could never be satisfied anyway.
collectionutil.MaxExplicitItemLimit backs validateOptionalLimit, and
COLLECTION_MAX_ITEMS in lib/collectionTemplates backs all seven Max
Items inputs (gallery forms + admin import/editor dialogs).

Co-Authored-By: Claude Fable 5 <[email protected]>
@Quick104
Quick104 merged commit 3503375 into main Jul 7, 2026
1 check passed
@Quick104
Quick104 deleted the claude/determined-moore-ee1757 branch July 7, 2026 14:46
Quick104 added a commit that referenced this pull request Jul 10, 2026
* fix(collections): repair broken builtin collection templates

A live audit of the builtin template catalog (all 40 MDBList URLs and all
10 TMDB franchise IDs fetched) found two dead sources, a silent bundle-apply
collision, and several templates whose defaults contradict their descriptions:

- Repoint mdblist_misc_a24 and mdblist_misc_criterion_collection to live
  lists; the original irvingbeano/shtluck lists were deleted on MDBList
  (404), so every sync of those collections failed.
- Retitle mdblist_charts_popular_movies to "IMDb MovieMeter Top 100". It
  shared the "popular-movies" title slug with tmdb_popular_movies, and
  bundle apply dedupes by slug per library, so applying all_defaults
  silently skipped it. Poster regenerated from the raw plate with the new
  title; new handler test asserts builtin title slugs stay unique.
- Raise the shared default limit 50 -> 100, give the IMDb Top 250 templates
  an explicit 250 (limit*4 fetch trim previously never scanned entries
  201-250), and drop the limit on catalog lists (Criterion, A24) so they
  hold every owned title.
- Correct IFC Films to MediaMovie (live list is 100% movies; as MediaMixed
  it was offered to TV libraries where it always synced empty) and fix the
  Trakt Popular descriptions (ratings-based, not "most-watched").
- Update stale limit docs in collection-templates.md.

Co-Authored-By: Claude Fable 5 <[email protected]>

* fix(collections): raise import limit caps above IMDb Top 250 default

The IMDb Top 250 templates now default to 250 items, but the template
config forms rendered their Max Items input with max=200 and the user
import API rejected limits above 200, so applying those templates from
the direct galleries failed native validation or got a 400.

Raise the cap to 500 on both sides, wired to shared constants: sync's
fetch trim (collectionSourceFetchMax) never scans more than 500 source
entries, so a larger explicit limit could never be satisfied anyway.
collectionutil.MaxExplicitItemLimit backs validateOptionalLimit, and
COLLECTION_MAX_ITEMS in lib/collectionTemplates backs all seven Max
Items inputs (gallery forms + admin import/editor dialogs).

Co-Authored-By: Claude Fable 5 <[email protected]>

---------

Co-authored-by: Claude Fable 5 <[email protected]>
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