Repository navigation
feat: filter by Plex player, and by several users - #4
Merged
Merged
Conversation
A board mounted over a TV should show whatever is playing on that TV, whoever is watching. Plex User only matched one account, so a household with separate accounts had to run two instances and switch between them. - New Plex Player setting (plex_player): only show streams on these devices, matched case-insensitively against the device name Plex shows. - Plex User and Plex Player both take comma-separated lists. When both are set, a stream must match both. Bumps the plugin to 1.3.0. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01A7aYfsnp25o3X3x3AYhzPQ
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.
Problem
The same user who reported the blank-between-episodes issue (#3) mounts a Note above their TV and wants it to show whatever is playing there. They and their partner use separate Plex accounts.
Plex User matches only one account. Their options were two plugin instances plus rules to switch between them, or pulling the data through Home Assistant at the media-player level. The board really cares about the device, not the account.
Change
plex_playersetting ("Plex Player"): only shows streams on these devices. It matches, case-insensitively, the device name Plex reports, which is the value of{{plex.player}}.plex_userandplex_playerboth take them, e.g.Sam, Kim. Spaces around names and empty entries are ignored. When both settings are set, a stream must match both.plex_uservalues behave exactly as before.stream_countdescription now names both filters.Limitation: the device name must match exactly (apart from case), so renaming a device in Plex means updating the setting.
Tests
There are 7 new tests in
TestFetchData, written before the implementation.test_existing_settings_keys_kept_and_optionalnow includesplex_player.Before the implementation, they failed on behavior:
test_player_filter_follows_whoever_uses_the_devicepassed before the change, since with no filter every stream shows. Mutations confirm it and the rest aren't vacuous:test_player_filter_follows_whoever_uses_the_devicetest_user_filter_accepts_several_users,test_user_filter_ignores_empty_entries,test_player_filter_accepts_several_devicestest_user_filter_accepts_several_users,test_player_filter_accepts_several_devicestest_user_filter_ignores_empty_entriestest_player_filter_shows_only_that_deviceand 3 moreResults:
./run_tests.sh: 132 passed,__init__.pyat 100% coverage.scripts/validate_plugins.py --plugin=plex --strict: passed.Not verified: I didn't test against a real Plex server. The device name comes from
Player.title, falling back toPlayer.product, the same value{{plex.player}}already exposes.🤖 Generated with Claude Code
https://claude.ai/code/session_01A7aYfsnp25o3X3x3AYhzPQ
Generated by Claude Code