Self-hosted web interface and downloader for Qobuz.

refactor(catalog): deduplicate release card enrichment and handler helpers #7

Open glerp.sullen.net
targeting main from glerp.sullen.net/gobuz:hygiene/catalog-enrichment-cleanup
Open opened by and assigned to glerp.sullen.net
targeting main from glerp.sullen.net/gobuz:hygiene/catalog-enrichment-cleanup

Summary #

  • Consolidate release card construction and library enrichment in internal/web/catalog (enrichRelease, newReleaseCard) so ReleaseHandler, buildReleaseCard, and buildArtistReleaseCard perform a single Library.Get lookup and use cmp.Or for fallback metadata fields.
  • Deduplicate MusicBrainzHandler by unifying downloaded and upstream release metadata into models.Release and extracting populateMusicBrainzReleases so RenderMusicBrainzReleases is called once.
  • Extract requestPageContext and handleRawSearch in catalog.go, and replace manual WaitGroup goroutine boilerplate and queue loops with wg.Go and slices.ContainsFunc.

Verification #

  • go test -count=1 ./...
  • go vet ./...
Commits 1

refactor(catalog): deduplicate release card enrichment and handler helpers