feat(movies): group movies and series by watch provider#77
Draft
bilipp wants to merge 1 commit into
Draft
Conversation
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
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
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
watch/providers, and the flatrate provider ids for the user's region (Locale.current.region) are folded intoTMDBTitleDetails. A new region-scopedwatch/providers/{movie,tv}list endpoint backs the picker. Split intoTMDBClient+WatchProviders.swiftto keep the file under the 600-line cap.Movie/Seriesstore their flatrate provider ids as a sentinel-delimited string (|8|337|) so alocalizedStandardContainspredicate can group titles in SQLite — the same trick the genre browse uses. A newWatchProvidercatalog@Modelholds the per-region name/logo metadata;WatchProviderSettingsholds the user's selection.applyMovieDetails/applySeriesDetailsbefore the cast guard, so the existing backgroundContentIndexerpass fills them across the whole catalog with no extra API calls — they ride along on the detail fetch it already makes.WatchProviderBrowse.swiftmirrorsGenreBrowse— a derivation that intersects selected with present providers, a logo-tile section, and provider detail grids reusingCategoryContentGrid. 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
xcodebuild test -scheme Lume -destination 'platform=iOS Simulator,name=iPhone 17 Pro,OS=26.4'— new WatchProvider suites green)--strict)WatchProviderIDsTests(id encoding/decoding/containment) +WatchProviderDerivationTests(selection ∩ presence, playlist scoping, ordering)Platforms
Related
Closes #20