Skip to content

feat(movies): group movies and series by watch provider#77

Draft
bilipp wants to merge 1 commit into
mainfrom
feat/streaming-provider-cluster
Draft

feat(movies): group movies and series by watch provider#77
bilipp wants to merge 1 commit into
mainfrom
feat/streaming-provider-cluster

Conversation

@bilipp

@bilipp bilipp commented Jun 17, 2026

Copy link
Copy Markdown
Owner

Summary

Adds a way to browse the catalog by streaming service — "show me everything on Netflix". The Movies and Series tabs gain a Browse by Provider section, and a new Settings → Streaming Providers screen lets the user pick which services to group by. Provider data comes from TMDB's watch-providers (flatrate / subscription offers only) and is resolved for the user's current country.

Implementation

  • TMDBClient: title-detail requests now append watch/providers, and the flatrate provider ids for the user's region (Locale.current.region) are folded into TMDBTitleDetails. A new region-scoped watch/providers/{movie,tv} list endpoint backs the picker. Split into TMDBClient+WatchProviders.swift to keep the file under the 600-line cap.
  • Models: Movie/Series store their flatrate provider ids as a sentinel-delimited string (|8|337|) so a localizedStandardContains predicate can group titles in SQLite — the same trick the genre browse uses. A new WatchProvider catalog @Model holds the per-region name/logo metadata; WatchProviderSettings holds the user's selection.
  • Enrichment: provider ids are populated inside applyMovieDetails/applySeriesDetails before the cast guard, so the existing background ContentIndexer pass fills them across the whole catalog with no extra API calls — they ride along on the detail fetch it already makes.
  • UI: WatchProviderBrowse.swift mirrors GenreBrowse — a derivation that intersects selected with present providers, a logo-tile section, and provider detail grids reusing CategoryContentGrid. The Settings screen is platform-adaptive (iOS/macOS list + tvOS detail pane) and is hidden when TMDB isn't configured.

Note: provider grouping is inherently dependent on TMDB enrichment progress (there is no provider fallback like genre has), so sections fill in as the background indexer runs.

Testing

  • Acceptance criteria met (flatrate-only, country-aware, settings to add/remove providers, shown on movies/series with provider icon)
  • Tests pass (xcodebuild test -scheme Lume -destination 'platform=iOS Simulator,name=iPhone 17 Pro,OS=26.4' — new WatchProvider suites green)
  • SwiftLint clean (--strict)
  • Tests added — WatchProviderIDsTests (id encoding/decoding/containment) + WatchProviderDerivationTests (selection ∩ presence, playlist scoping, ordering)

Platforms

  • iOS / iPadOS
  • tvOS
  • macOS
  • visionOS

Related

Closes #20

Adds a TMDB watch-provider (streaming service) grouping dimension to the
Movies and Series tabs, plus a Settings screen to pick which providers to
browse by, country-aware via the user's locale.

- TMDBClient: append watch/providers to title-detail requests (flatrate
  only) and add a region-scoped provider-list endpoint; new
  TMDBClient+WatchProviders.swift keeps the file within the size cap.
- Movie/Series store flatrate provider ids (sentinel-delimited string for
  SQLite grouping); enrichment populates them during the existing detail
  and background-indexer passes (no extra API calls).
- New WatchProvider catalog @model + WatchProviderSettings (selected ids).
- Browse-by-Provider section + provider detail grids mirror the genre
  browse; Settings screen (iOS/macOS + tvOS) refreshes the catalog and
  toggles selection.
- en/de localization, unit tests for id encoding and derivation.

Closes #20
@bilipp bilipp marked this pull request as draft July 1, 2026 08:02
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.

feat: group content by watch providers

1 participant