mirror of
https://github.com/LukeHagar/plexcsharp.git
synced 2025-12-06 20:47:49 +00:00
Media
(Media)
Overview
API Calls interacting with Plex Media Server Media
Available Operations
- MarkPlayed - Mark Media Played
- MarkUnplayed - Mark Media Unplayed
- UpdatePlayProgress - Update Media Play Progress
MarkPlayed
This will mark the provided media key as Played.
Example Usage
using PlexAPI;
using PlexAPI.Models.Components;
using PlexAPI.Models.Requests;
var sdk = new PlexAPISDK(
security: new Models.Components.Security() {
AccessToken = "<YOUR_API_KEY_HERE>",
});
var res = await sdk.Media.MarkPlayedAsync(Key: 59398D);
// handle response
Parameters
| Parameter | Type | Required | Description | Example |
|---|---|---|---|---|
Key |
double | ✔️ | The media key to mark as played | 59398 |
Response
MarkUnplayed
This will mark the provided media key as Unplayed.
Example Usage
using PlexAPI;
using PlexAPI.Models.Components;
using PlexAPI.Models.Requests;
var sdk = new PlexAPISDK(
security: new Models.Components.Security() {
AccessToken = "<YOUR_API_KEY_HERE>",
});
var res = await sdk.Media.MarkUnplayedAsync(Key: 59398D);
// handle response
Parameters
| Parameter | Type | Required | Description | Example |
|---|---|---|---|---|
Key |
double | ✔️ | The media key to mark as Unplayed | 59398 |
Response
UpdatePlayProgress
This API command can be used to update the play progress of a media item.
Example Usage
using PlexAPI;
using PlexAPI.Models.Components;
using PlexAPI.Models.Requests;
var sdk = new PlexAPISDK(
security: new Models.Components.Security() {
AccessToken = "<YOUR_API_KEY_HERE>",
});
var res = await sdk.Media.UpdatePlayProgressAsync(Key: "string", Time: 6900.91D, State: "string");
// handle response
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
Key |
string | ✔️ | the media key |
Time |
double | ✔️ | The time, in milliseconds, used to set the media playback progress. |
State |
string | ✔️ | The playback state of the media item. |