Skip to content

Show genres on detail pages and fill them on scrobble - #1433

Merged
dannyvfilms merged 9 commits into
latestfrom
claude/project-thread-4ksqq8
Oct 5, 2026
Merged

dannyvfilms merged 9 commits into
latestfrom
claude/project-thread-4ksqq8

Conversation

@dannyvfilms

@dannyvfilms dannyvfilms commented Oct 2, 2026 •

Copy link
Copy Markdown
Owner

Requested by Daniel · project thread

Summary

  • Carries contributor PR Show genres on detail pages and fill them on scrobble #1311 by @crimsonsunset onto latest. Their five content commits are kept with their authorship; one had a small conflict with the new music track page code, resolved by keeping both. Show genres on detail pages and fill them on scrobble #1311's merge-of-latest commit is left out.
  • Music artist, album, podcast and episode pages now show genre chips. A scrobble fills an empty album from its MusicBrainz release group, then falls back to the artist's genres, then copies the first non-empty list onto empty album, track, item and artist rows.
  • On top, one commit adds tests and fixes an ordering bug: the artist's genres were copied onto an empty album before the release-group fill ran, so that fill never happened for artists that already had genres.
  • No longer stacked on Redesign desktop media details overview #1424: the two PRs share no files, so this can merge in either order.

Screenshots

Before: these pages had no genre chips (the new tests fail without the change).

After: artist, album (own genres and artist fallback) and podcast pages are on this page: https://claude.ai/artifact/CkCsetqcb4wBcxPaeQPymX (private until shared).

Not shown: the episode page, which needs TMDB season data.

  • No UI change (nothing visible is different, so no screenshots needed)

AI Assistance

Claude Sonnet 5.5 (claude-sonnet-5-5) moved the commits onto latest, wrote the tests and the ordering fix, and ran the browser check.

How It Was Tested

  • scripts/test.sh app.tests.test_music_genres -> Passed (10 tests; the page and copy tests fail without Show genres on detail pages and fill them on scrobble #1311)
  • scripts/test.sh over every music test module, the podcast show, template tag and users suites -> 1569 run, 2 errors, both Playwright browser-launch failures in the sandbox
  • uv run --no-sync ruff check src -> Passed

Public API & Documentation Handoff

  • Not applicable (no API or vocabulary changes)

Human Review & Quality Assurance

  • Code review completed
  • Visual or manual QA verified (e.g. /gstack-qa or browser testing)

Database & Migration Safety (Only if modifying models)

  • Not applicable (no database changes)

Related Issues

Supersedes #1311 (to be closed with credit once this merges). Refs #1424.

🤖 Generated with Claude Code

https://claude.ai/code/session_01WNPhmcXNv6M1Beby8LQime

@dannyvfilms dannyvfilms self-assigned this Oct 2, 2026

Copy link
Copy Markdown
Owner Author

test (3.12) is red here because of #1424, not this PR's changes.

Four browser tests in app.tests.test_integration fail: test_tv_completed, test_season_completed, test_home_poster_action_modal_is_visible_on_touch and test_movie_split_track_modal_close_button_and_release_date. They pass on latest (e6bbc9e), fail on #1424's head (5430675) with none of this PR's commits, and fail the same way here. #1424 has no CI run of its own because it conflicts with latest.

Likely cause, from the browser console (htmx:targetError): #1424 wraps the track modals in <template x-teleport="body">, so the Add form is no longer inside [data-track-action-root] and its hx-target="closest [data-track-action-root]" finds nothing. The save request is never sent.

No fix exists yet, and it belongs in #1424, so I'm not widening this PR. It stays red until #1424 is fixed.


Generated by Claude Code

crimsonsunset and others added 6 commits October 5, 2026 01:10
- The artist view already built genre_chips from MusicBrainz, but the
  template never rendered them.
- Register a Genres sidebar section for music_artist so the layout
  settings can show and reorder it.
- After the write transaction, fill an album saved without genres from
  its MusicBrainz release group, then resync the play.
- Plays fall back to the album artist's genres when the album has none.
- Store artist genres from scrobbles as names, matching the artist page,
  instead of raw MusicBrainz genre objects.
Album and podcast show rows already store genres, but those detail
pages never rendered them. Register the album sidebar section the
same way artist pages already do.
Season metadata already copies the show's genres. The episode page
never rendered them.
- Copy the first non-empty list onto the related rows that are still empty, including after a listen hook writes one.
- Show artist genres on the album and artist pages when the album itself has none.
- The artist's genres were copied onto an empty album while the scrobble item
  was created, so the release-group fill never ran for artists with genres.
  Note the empty album before that copy and use it as the gate.
- Add tests for the genre copy rules, the artist/album/podcast chips, and the
  scrobble fill order.
- Tidy a docstring line that had been joined.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WNPhmcXNv6M1Beby8LQime
@dannyvfilms
dannyvfilms force-pushed the claude/project-thread-4ksqq8 branch from 8d992a8 to 8aa3219 Compare October 5, 2026 01:19
@dannyvfilms dannyvfilms changed the title Show genres on detail pages and fill them on scrobble (#1311 on #1424) Show genres on detail pages and fill them on scrobble Oct 5, 2026
@dannyvfilms
dannyvfilms changed the base branch from codex/media-details-overview to latest October 5, 2026 01:19
@dannyvfilms
dannyvfilms marked this pull request as ready for review October 5, 2026 01:19
@dannyvfilms
dannyvfilms enabled auto-merge October 5, 2026 01:19

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 8aa3219248

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

if album and not getattr(event, "defer_cover_prefetch", False):
if album_needs_genre_fill:
try:
populate_album_implied_genres(album)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Fetch release-group genres before applying artist fallback

When an empty album with a release-group ID belongs to an artist that already has genres, _get_or_create_item() calls sync_music_item_genres_from_album(), which copies the artist fallback through the item and into the album before this call. populate_album_implied_genres() then treats those artist genres as the album's direct genres, so _album_direct_genres() never calls get_release_group_genres() and the album permanently retains the less-specific artist genres. The saved album_needs_genre_fill flag does not force a provider lookup; the release-group fill must happen before the fallback is persisted or explicitly bypass existing album genres.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch, you were right: the flag alone still let populate_album_implied_genres keep the artist's genres. Fixed in d237f45. The scrobble now fetches the release group's genres and puts them on the album before filling, and keeps the artist fallback only when the release group has none. The new test mocks the MusicBrainz call instead of the fill, and it fails on the previous commit.


Generated by Claude Code

@dannyvfilms dannyvfilms mentioned this pull request Oct 5, 2026
5 of 7 tasks
claude added 3 commits October 5, 2026 05:00
- An album holding the artist's genres made the release-group lookup skip
  itself. Fetch the release group's list first and put it on the album.
- Test the real lookup path (mock the MusicBrainz call, not the fill) and the
  no-genres case that keeps the fallback.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WNPhmcXNv6M1Beby8LQime
Keep the release-group genre fill before the new listen hook and the genre
match after it, so a hook that writes genres is matched too.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WNPhmcXNv6M1Beby8LQime
Keep both the album genre helper and the new play-link helpers in music_views.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WNPhmcXNv6M1Beby8LQime
@dannyvfilms
dannyvfilms merged commit 00a3dba into latest Oct 5, 2026
11 checks passed
@dannyvfilms
dannyvfilms deleted the claude/project-thread-4ksqq8 branch October 5, 2026 10:34
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.

3 participants