Files
plexruby/docs/sdks/media

Media

Overview

API Calls interacting with Plex Media Server Media

Available Operations

mark_played

This will mark the provided media key as Played.

Example Usage

require_relative plexruby


s = OpenApiSDK::PlexAPI.new
s.config_security(
  security=Shared::Security.new(
    access_token="<YOUR_API_KEY_HERE>",
  )
)


req = Operations::MarkPlayedRequest.new(
  key=59398,
)
    
res = s.media.mark_played(key=59398)

if res.status == 200
  # handle response
end

Parameters

Parameter Type Required Description Example
key Float ✔️ The media key to mark as played 59398

Response

T.nilable(Operations::MarkPlayedResponse)

mark_unplayed

This will mark the provided media key as Unplayed.

Example Usage

require_relative plexruby


s = OpenApiSDK::PlexAPI.new
s.config_security(
  security=Shared::Security.new(
    access_token="<YOUR_API_KEY_HERE>",
  )
)


req = Operations::MarkUnplayedRequest.new(
  key=59398,
)
    
res = s.media.mark_unplayed(key=59398)

if res.status == 200
  # handle response
end

Parameters

Parameter Type Required Description Example
key Float ✔️ The media key to mark as Unplayed 59398

Response

T.nilable(Operations::MarkUnplayedResponse)

update_play_progress

This API command can be used to update the play progress of a media item.

Example Usage

require_relative plexruby


s = OpenApiSDK::PlexAPI.new
s.config_security(
  security=Shared::Security.new(
    access_token="<YOUR_API_KEY_HERE>",
  )
)


req = Operations::UpdatePlayProgressRequest.new(
  key="<key>",
  time=6900.91,
  state="string",
)
    
res = s.media.update_play_progress(key="string", time=8015.87, state="string")

if res.status == 200
  # handle response
end

Parameters

Parameter Type Required Description
key String ✔️ the media key
time Float ✔️ The time, in milliseconds, used to set the media playback progress.
state String ✔️ The playback state of the media item.

Response

T.nilable(Operations::UpdatePlayProgressResponse)