(media)
API Calls interacting with Plex Media Server Media
- mark_played - Mark Media Played
- mark_unplayed - Mark Media Unplayed
- update_play_progress - Update Media Play Progress
- get_banner_image - Get Banner Image
- get_thumb_image - Get Thumb Image
This will mark the provided media key as Played.
require 'plex_ruby_sdk'
s = ::PlexRubySDK::PlexAPI.new
s.config_security(
::PlexRubySDK::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
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
key |
::Float | ✔️ | The media key to mark as played | 59398 |
T.nilable(::PlexRubySDK::Operations::MarkPlayedResponse)
This will mark the provided media key as Unplayed.
require 'plex_ruby_sdk'
s = ::PlexRubySDK::PlexAPI.new
s.config_security(
::PlexRubySDK::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
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
key |
::Float | ✔️ | The media key to mark as Unplayed | 59398 |
T.nilable(::PlexRubySDK::Operations::MarkUnplayedResponse)
This API command can be used to update the play progress of a media item.
require 'plex_ruby_sdk'
s = ::PlexRubySDK::PlexAPI.new
s.config_security(
::PlexRubySDK::Shared::Security.new(
access_token: "<YOUR_API_KEY_HERE>",
)
)
res = s.media.update_play_progress(key="<key>", time=90000.0, state="played")
if res.status_code == 200
# handle response
end
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 |
T.nilable(::PlexRubySDK::Operations::UpdatePlayProgressResponse)
Gets the banner image of the media item
require 'plex_ruby_sdk'
s = ::PlexRubySDK::PlexAPI.new
s.config_security(
::PlexRubySDK::Shared::Security.new(
access_token: "<YOUR_API_KEY_HERE>",
)
)
req = ::PlexRubySDK::Operations::GetBannerImageRequest.new(
rating_key: 9518,
width: 396,
height: 396,
min_size: 1,
upscale: 1,
x_plex_token: "CV5xoxjTpFKUzBTShsaf",
)
res = s.media.get_banner_image(req)
if ! res.bytes.nil?
# handle response
end
Parameter | Type | Required | Description |
---|---|---|---|
request |
::PlexRubySDK::Operations::GetBannerImageRequest | ✔️ | The request object to use for the request. |
T.nilable(::PlexRubySDK::Operations::GetBannerImageResponse)
Gets the thumbnail image of the media item
require 'plex_ruby_sdk'
s = ::PlexRubySDK::PlexAPI.new
s.config_security(
::PlexRubySDK::Shared::Security.new(
access_token: "<YOUR_API_KEY_HERE>",
)
)
req = ::PlexRubySDK::Operations::GetThumbImageRequest.new(
rating_key: 9518,
width: 396,
height: 396,
min_size: 1,
upscale: 1,
x_plex_token: "CV5xoxjTpFKUzBTShsaf",
)
res = s.media.get_thumb_image(req)
if ! res.bytes.nil?
# handle response
end
Parameter | Type | Required | Description |
---|---|---|---|
request |
::PlexRubySDK::Operations::GetThumbImageRequest | ✔️ | The request object to use for the request. |