mirror of
https://github.com/LukeHagar/plexruby.git
synced 2025-12-06 12:47:44 +00:00
4.7 KiB
4.7 KiB
Media
Overview
API Calls interacting with Plex Media Server Media
Available Operations
- mark_played - Mark Media Played
- mark_unplayed - Mark Media Unplayed
- update_play_progress - Update Media Play Progress
mark_played
This will mark the provided media key as Played.
Example Usage
require 'plexruby'
s = ::OpenApiSDK::PlexAPI.new(
x_plex_client_identifier: "Postman",
)
s.config_security(
::OpenApiSDK::Shared::Security.new(
access_token: "<YOUR_API_KEY_HERE>",
)
)
res = s.media.mark_played(key=59398.0)
if res.status_code == 200
# handle response
end
Parameters
| Parameter | Type | Required | Description | Example |
|---|---|---|---|---|
key |
::Float | ✔️ | The media key to mark as played | 59398 |
Response
T.nilable(::OpenApiSDK::Operations::MarkPlayedResponse)
mark_unplayed
This will mark the provided media key as Unplayed.
Example Usage
require 'plexruby'
s = ::OpenApiSDK::PlexAPI.new(
x_plex_client_identifier: "Postman",
)
s.config_security(
::OpenApiSDK::Shared::Security.new(
access_token: "<YOUR_API_KEY_HERE>",
)
)
res = s.media.mark_unplayed(key=59398.0)
if res.status_code == 200
# handle response
end
Parameters
| Parameter | Type | Required | Description | Example |
|---|---|---|---|---|
key |
::Float | ✔️ | The media key to mark as Unplayed | 59398 |
Response
T.nilable(::OpenApiSDK::Operations::MarkUnplayedResponse)
update_play_progress
This API command can be used to update the play progress of a media item.
Example Usage
require 'plexruby'
s = ::OpenApiSDK::PlexAPI.new(
x_plex_client_identifier: "Postman",
)
s.config_security(
::OpenApiSDK::Shared::Security.new(
access_token: "<YOUR_API_KEY_HERE>",
)
)
res = s.media.update_play_progress(key="<value>", time=90000.0, state="played")
if res.status_code == 200
# handle response
end
Parameters
| Parameter | Type | Required | Description | Example |
|---|---|---|---|---|
key |
::String | ✔️ | the media key | |
time |
::Float | ✔️ | The time, in milliseconds, used to set the media playback progress. | 90000 |
state |
::String | ✔️ | The playback state of the media item. | played |
Response
T.nilable(::OpenApiSDK::Operations::UpdatePlayProgressResponse)