Skip to content

Comments

feat: add musicbrainz metadata import#56

Merged
PascalRepond merged 1 commit intomainfrom
rep-dev
Jan 21, 2026
Merged

feat: add musicbrainz metadata import#56
PascalRepond merged 1 commit intomainfrom
rep-dev

Conversation

@PascalRepond
Copy link
Owner

No description provided.

@coderabbitai
Copy link

coderabbitai bot commented Jan 21, 2026

📝 Walkthrough

Walkthrough

This PR adds MusicBrainz music metadata service integration. It creates a new API client module to search releases and download cover art, adds URL routing for HTMX searches, extends the views to fetch MusicBrainz data and render search results, and updates templates to provide a MusicBrainz search interface within the media import workflow.

Changes

Cohort / File(s) Summary
MusicBrainz API Client Service
src/core/services/musicbrainz.py
New module implementing MusicBrainz client with search, release details retrieval, and cover art management. Includes constants, custom exception, data class for results, and MusicBrainzClient class with request handling, validation, and cover download logic.
Views Integration
src/core/views.py
Adds helper functions _get_import_data_from_request() and _fetch_musicbrainz_data() to handle MusicBrainz data fetching. Introduces new HTMX endpoint musicbrainz_search_htmx() for live search. Refactors media_edit to use new import data handler and extends _download_cover() to support MusicBrainz cover sources.
URL Routing
src/core/urls.py
Adds new URL pattern for MusicBrainz HTMX search endpoint (musicbrainz-search/).
Import Template UI
src/templates/base/media_import.html
Introduces MusicBrainz as new import source with radio tab and panel. Adds search input, button, and result target. Updates existing tab handlers to toggle MusicBrainz visibility.
Search Results Template
src/templates/partials/musicbrainz/musicbrainz_suggestions.html
New partial template rendering MusicBrainz search results with error states, suggestion cards (cover image, title, year, country, artists, label), and fallback messaging.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

  • feat: add tags system and TMDB import integration #54: Modifies src/core/views.py to add HTMX endpoints and helper functions for pre-filling media_edit from external APIs, establishing a similar pattern for integrating external metadata sources (TMDB) that this PR extends for MusicBrainz.
🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 inconclusive)
Check name Status Explanation Resolution
Description check ❓ Inconclusive No description was provided by the author, making it impossible to assess whether the description relates to the changeset. Add a pull request description explaining the MusicBrainz integration, its purpose, and how it fits into the application's import workflow.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change: adding MusicBrainz metadata import functionality, which is the primary focus of all file modifications.
Docstring Coverage ✅ Passed Docstring coverage is 91.67% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@PascalRepond PascalRepond merged commit b74c549 into main Jan 21, 2026
3 checks passed
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