Repository navigation
The player of every Plex play, and the moods of every artist - #241
Merged
Merged
Conversation
Groundwork for the Wrap-Up's rhythm clock and "phone after midnight",
measured on the real server.
Player: every Plex history event names its device; /devices gives its
name and platform ("iPhone" / "iOS"). The sync and the history import
write player (new column) and platform for every Plex play
(plex_sync.fetch_players / player_of). A one-time custodian job,
plex_players, fills the plays already stored; most music events no longer
carry a ratingKey (the track was re-added), so a play is also found by its
second and title. On a copy of the NAS data ~19,000 music plays got their
player; 968 plays were on a phone between midnight and 5 am.
Artist moods: Plex keeps moods and styles per artist, only in an artist's
own metadata. A daily custodian job, artist_tags, reads them into the Plex
music index (plex_artists in lyrics.db: moods, styles, genres, country,
tags_at), 300 artists a run, most-played first, again after 90 days.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
# Conflicts: # src/database/models.py
… the arrows) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Oct 25, 2026
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.
What & why
This is the groundwork for the Wrap-Up's rhythm clock and the "phone after midnight" story (priority 6 in
docs/WRAPUP_V2_BLUEPRINT.md). It was measured against the real Plex server, read only.The player of a play
deviceID)./devicesmaps that to a name and a platform ("iPhone" / "iOS", "Chromecast Google TV" / "Android").platformwas only ever filled from Spotify.player(new column) andplatformfor every Plex play.plex_sync.fetch_playersreads/devicesonce a sync.player_oftakes a play's own event, else the same item's event within 90 s.plex_players(no model), fills them from the whole history Plex still holds.ratingKey, because the track was re-added. So a stored play is also found by its second (±2 s) and title.The moods of an artist
artist_tags(no model), reads them into the Plex music index: new columns onplex_artistsin lyrics.db (moods,styles,genres,country,tags_at).Checks
python tests/run_all.pyis green (254/254)tests/test_plex_players.py(16 checks):player_of;fill_playersby key and by second + title, with Spotify untouched;🤖 Generated with Claude Code