Skip to content

Music moods and styles from Plex, and the player of the night in the Wrap-Up - #242

Merged
Randomname653 merged 3 commits into
mainfrom
claude/bold-johnson-w1warc
Oct 25, 2026
Merged

Randomname653 merged 3 commits into
mainfrom
claude/bold-johnson-w1warc

Conversation

@Randomname653

@Randomname653 Randomname653 commented Oct 25, 2026 •

Copy link
Copy Markdown
Owner

What & why

This PR adds the Plex music moods and styles from telemetry priority 6 in docs/WRAPUP_V2_BLUEPRINT.md. Track genres were a comma string, so nothing told the Wrap-Up how the music felt. It could not say "mornings ran Energetic, nights Melancholy" or "after 23:00 it was the iPhone".

Rebuilt on current main: the player part is gone, and the player now comes from the watch_history.player / platform that #241 added.

Moods and styles (services/music_tags.py, table music_tags)

  • Custodian job: music_tags runs every 72 h without a model. It reads Plex's own moods and styles for every music section, the way Plex's filter bar does.
  • Filter lists: for each kind and level it lists the tags (/library/sections/{key}/{mood|style}?type=…), then the items under each tag.
    • Moods are read on artists, albums and tracks (types 8/9/10).
    • Styles are read on artists and albums (types 8/9).
    • This matches the real server: about 300 moods per type, 685 / 580 styles, and an empty style list for tracks.
  • Item tags: the plain artist and album listings' own Mood / Style are read too.
  • Replacement: only a walk that read a whole section replaces that section's rows.
  • A play's tags:
    • A track takes its own moods, else its album's, else its artist's. Styles come from the album, else the artist.
    • Album and artist come from the music index (track_lyrics) by the play's key.
    • Most track events in the history carry no ratingKey, so a play the index does not know by key is matched by artist and album name, else by the artist's name alone.

Wrap-Up (FACTS_VERSION 10; 9 is taken by #243)

  • music.moods: the leading moods and styles over the played time, and the leading mood of each part of the day on the user's clock. It needs at least a third of the music time tagged.
  • devices: the players by hours (player, else platform read as its family, so "iOS 17.1 (iPhone14,2)" counts as iPhone) and the player of the night. It needs at least half the time with a known player, and at least two players.
  • Output: new fact-sheet lines, plus two insight cards: day versus night soundtrack (contrast) and the player of the night (rhythm).

When this is merged, the artist_tags job from #241 can go (the owner takes it out).

Checks

  • python tests/run_all.py is green (256/256 suites)
  • Behaviour changes come with a test that would have caught the old behaviour. tests/test_music_moods.py (25 checks) covers:
    • the filter walk and the items' own tags;
    • a failed listing keeping the stored rows;
    • per-section replacement;
    • the track > album > artist rule;
    • the name fallback against a real index file (key, artist + album, artist alone, unknown);
    • moods by part of the day, the coverage floor and players by hours;
    • platform families, the cards and the fact sheet.
  • No personal data, tokens or hardcoded local paths in the diff
  • Based on current main

🤖 Generated with Claude Code

https://claude.ai/code/session_01KECJpoVqo39hQKxkrxUjrc

…Wrap-Up

Nothing said how the music felt. A custodian walk reads Plex's own
moods and styles per artist, album and track into music_tags, through
Plex's filter lists; a play takes its track's moods, else its album's,
else its artist's, found by key or, for history events without a
ratingKey, by artist and album names.

The Wrap-Up reads the leading moods and styles, the mood of each part
of the day, and the players by hours from watch_history.player, with
two new cards (FACTS_VERSION 10).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KECJpoVqo39hQKxkrxUjrc
@Randomname653
Randomname653 force-pushed the claude/bold-johnson-w1warc branch from 7c0f2e1 to f0803b1 Compare October 25, 2026 11:49
@Randomname653 Randomname653 changed the title Music moods and styles from Plex, and the player of each play Music moods and styles from Plex, and the player of the night in the Wrap-Up Oct 25, 2026

Copy link
Copy Markdown
Owner Author

security-scan failed, but not because of this PR. The OpenAI API answered every request with 429 insufficient_quota / credit_balance_exhausted, so no file was actually analysed: all 7 files errored, and the run reported 0 vulnerabilities. This is the same failure as on #229–#240. It will pass once the account has credits again; nothing on this branch can fix it, and I can't re-run the job from here.


Generated by Claude Code

Randomname653 and others added 2 commits October 25, 2026 12:52
# Conflicts:
#	src/services/data_custodian.py
#	src/services/wrapup_facts.py
…e it 10)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Randomname653
Randomname653 merged commit 30631e4 into main Oct 25, 2026
9 of 10 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.

2 participants