Repository navigation
Conversation
chenqi92
reviewed
Dec 2, 2026
chenqi92
left a comment
Owner
There was a problem hiding this comment.
- On iOS and Mac the new sections never load:
.task(id:)hangs off aGroup { if … }that is empty until the data arrives, so the task never runs (main has a note about this inKaraokeStageView). Similar Artists never shows, and the profile card only appears after something else wrote a record. - Commons photos: the attribution lives only in
ArtistMetadataStore(500 records, oldest evicted), while the cached portrait is used as the artist image in every list, grid and shelf on iOS, Mac and tvOS. Store author / licence / link with the image and show the credit wherever the photo appears, or use the photo only on the detail page next to its credit. Also reject GFDL-only files, readRestrictionsandAttributionRequired, link the licence, and don't credit with the licence alone when the author is missing. - Nothing is opt-in. tvOS hard-codes
allowNetwork: true: every artist page visit sends the artist name and album titles to MusicBrainz, Wikidata, Commons and Last.fm and replaces the grid artwork. On iOS / Mac the existing Wikipedia bio button now also saves a profile and portrait, and after that every visit downloads the portrait and re-runs custom artist scrapers (the done-marker is memory-only, so again after each launch). Please put profiles and photos behind a switch that is off by default, follow the app's cellular / no-network settings, and fetch on demand instead of per visit. - The batch "Public Sources" fill downloads a portrait for every artist, but its text only mentions introductions.
- Removing the Fanart key, turning Fanart off or removing a custom scraper leaves its images cached and still shown. Purge them.
- MusicBrainz:
musicBrainz(_:)is re-entrant across its sleep, so concurrent callers fire together, and it doesn't share pacing withMusicBrainzScraper. Use one 1 req/s quota for both and back off on 503. Droptags+genresfrominc: they aren't CC0 and nothing shows them. - tvOS: the first run happens before the album shelves load, resolves to nil and sets a 6-hour retry block, so the run that has the albums never happens. The fetch task isn't cancelled with the view either.
- In the artwork editor every failure (revoked key, 429, offline) shows as "no matching portrait".
ScraperJSONRulegains a case and a defaultedformat, so synced configs fail to decode on older versions. Header templating now applies to every custom scraper, not just artist endpoints.- Main actor:
ScraperSettings.load()runs inside body-computed task IDs, the 500-record file loads synchronously on first access,matchingLibraryArtistsdoes up to 50 catalog lookups on the main actor, andfailures/retryAfterByID/customEnrichedRevisionByIDgrow without a cap. - Design: on tvOS put the profile block after the albums, not between the bio and the album shelves (#549 asks for albums first). Drop the Bandcamp store link. Fanart.tv images need a fanart.tv credit next to them, and the custom-source wordmark needs the same toggle as the others.
- The tests build the store with the real
FanartTvSettingsStore.sharedandCustomArtistScraperCoordinator.shared, so on a machine with a key they hit the network. - This is five features in one commit. Please split it (profiles, Commons photos, Fanart.tv, custom artist scrapers, similar artists) so each can be checked and merged on its own.
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.
Closes #540
Summary
1. Public-source artist metadata, portraits & library-matched similar artists
ArtistMetadata.swift,ArtistMetadataStore.swift,LibraryInsightStore.swift): Cross-check local album titles against MusicBrainz release groups before binding homonymous artists; fetch and cache (bounded LRU) entity type, origin/country, active lifespan, band member / member-of relations, and validated external links.P18/ Wikimedia Commons artist portraits (WikimediaArtistPortraitPolicy.swift,ArtworkFetchService.swift): Enforce open-license andupload.wikimedia.orgallowlist checks, store in dedicatedartist-wikimedia-v1namespace, and display photographer/license attribution when Wikimedia provides the active portrait.SimilarArtistsService.swift,ArtistSimilarArtistsSectionView.swift,LibraryInsightBatchMode.swift,LibraryInsightBatchFill.swift): Resolve similar artists via Last.fm filtered strictly against artists present in the user's library (excluding self) on iOS, macOS, and Apple TV; add public-sources-first / public-sources-only batch insight fill.2. Optional Fanart.tv BYOK support
FanartTvPolicy.swift,FanartTvService.swift): Users provide their own Fanart.tv API Key (and optional Personal Client Key) stored exclusively inKeychainService(syncing via iCloud Keychain when enabled), with connection testing and key removal.ArtworkFetchService.swift,ArtistHeroArtworkView.swift): Cache HD portraits inartist-fanart-v1and raw transparent PNG wordmark logos (hdmusiclogo/musiclogo, preserving PNG alpha without JPEG compression) inartist-fanart-logo-v1, feeding the existing iOSArtistHeroTitleBlock.nameArtworkslot behind a user toggle.FanartTvSettingsView.swift,SettingsView.swift,MacSettingsView.swift,TVFanartTvSettingsView.swift,TVScraperSettingsView.swift): No external subscription or payment links.3. Custom scraper configuration extension (
"artist"capability)ScraperConfig.swift,ScraperConfigStore.swift,ScraperTypes.swift,ScraperSettingsStore.swift,ScraperJSONRule.swift):"artist"capability and optionalartist: EndpointConfigendpoint, wired through import preview/review, validation, subscription refresh, CloudKit sync, and LAN QR transfer (including<id>.secrets.jsonsidecar secrets).ScraperNetworkScope.origin(template:)while continuing to reject host/authority placeholders.ScraperJSONRulewith optionalpathsfallback lists, defaultformat = .jsonwhen omitted in JSON, and built-infanartArtistformat.CustomArtistScrapePolicy.swift,ConfigurableScraper+Artist.swift,CustomArtistScraperCoordinator.swift):{{artist}},{{query}},{{mbid}},{{album}},{{lang}},{{langBase}}, and{{secret.<key>}}in URL, query params, HTTP headers (CRLF-stripped), and body templates, failing closed when required secrets or MBIDs are missing.assetHostsallowlist on all returned artwork URLs and verify artist identity on array results.Artwork Precedence & Cross-Platform Delivery
User override > Source-owned > Apple Music (AM artists only) > Enabled custom artist scrapers (priority order) > Fanart.tv BYOK > Wikimedia Commons > Borrowed song cover(CachedArtworkView.swift,TVArtistArtworkView.swift). Wikimedia Commons CC attribution (ArtistMetadataSectionView.swift,TVArtistMetadataSectionView.swift) is shown only when the cached Wikimedia portrait is active.WikimediaArtistArtworkButton.swift): Exposes manual fetch actions for enabled custom artist scrapers, Fanart.tv (when active), and Wikimedia Commons on iOS & macOS.ArtistHeroTitleBlockslot and exposes the wordmark toggle in Settings; macOS (MacDetailHeader) and Apple TV (TVArtistDetailView) use text artist headers and omit the iOS-only wordmark toggle..lproj/Localizable.stringsfiles (validated withplutil -lint).Verification
origin/mainc4ee8513eate3309063f):xcrun swift test --filter "ArtistMetadataTests|WikimediaArtistPortraitTests|LibraryInsightBatchModeTests|FanartTvPolicyTests|CustomArtistScrapePolicyTests|ScraperJSONRuleTests": 27/27 passed (ScraperJSONRuleTests7/7 + 20/20 Swift Testing tests across 5 suites).project.pbxprojontoc4ee8513e; zero source-file overlap with the 7 interveningorigin/maincommits):xcodebuild test -scheme PrimuseMac -destination 'platform=macOS' -only-testing:PrimuseMacTests/ArtistMetadataStoreTests -only-testing:PrimuseMacTests/FanartTvServiceTests -only-testing:PrimuseMacTests/CustomArtistScraperTests: 9/9 passed (TEST SUCCEEDED).xcodebuild build-for-testing -scheme Primuse -destination 'generic/platform=iOS Simulator' ONLY_ACTIVE_ARCH=YES ARCHS=arm64:TEST BUILD SUCCEEDED.xcodebuild build-for-testing -scheme PrimuseTV -destination 'generic/platform=tvOS Simulator' ONLY_ACTIVE_ARCH=YES ARCHS=arm64:TEST BUILD SUCCEEDED.c4ee8513e..e3309063fwith XcodeGen2.46.0):python3 -I scripts/gate/gate.py --root . --require-all --strict-baselines --range origin/main..HEAD: 0 errors, 0 warnings, 0 skipped.python3 -I scripts/gate/gate.py --root . --commits origin/main..HEAD: 0 errors, 0 warnings, 0 skipped.1174.9.2) is older than the installed Xcode (1174.21.0).