Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions tests/test_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,25 @@ def fetchItem(self, key: str) -> FakeMedia:
assert play_call["kwargs"]["machineIdentifier"] == "server-001"
assert play_call["kwargs"]["offset"] == 0

play_requests.clear()
fetch_requests.clear()

offset_seconds = 37
offset_result = asyncio.run(
server.play_media.fn(
identifier="49915", player="Living Room", offset_seconds=offset_seconds
)
)

assert offset_result["player"] == "Living Room"
assert offset_result["rating_key"] == "49915"
assert offset_result["offset_seconds"] == offset_seconds
assert fetch_requests == ["/library/metadata/49915"]
assert play_requests, "Expected plexapi playMedia call with offset"
offset_call = play_requests[0]
assert offset_call["kwargs"]["machineIdentifier"] == "server-001"
assert offset_call["kwargs"]["offset"] == offset_seconds * 1000


def test_play_media_requires_player_capability(monkeypatch):
monkeypatch.setenv("PLEX_URL", "http://plex.test:32400")
Expand Down