package main
import(
"context"
"github.com/LukeHagar/plexgo"
"log"
)
func main() {
ctx := context.Background()
s := plexgo.New(
plexgo.WithSecurity("<YOUR_API_KEY_HERE>"),
)
res, err := s.Status.GetBackgroundTasks(ctx)
if err != nil {
log.Fatal(err)
}
if res.Object != nil {
// handle response
}
}{
"MediaContainer": {
"identifier": "<string>",
"offset": 123,
"size": 123,
"totalSize": 123,
"TranscodeJob": [
{
"generatorID": 123,
"key": "<string>",
"progress": 50,
"ratingKey": "<string>",
"remaining": 123,
"size": 123,
"speed": 123,
"targetTagID": 123,
"thumb": "<string>",
"title": "<string>",
"type": "transcode"
}
]
}
}Get the list of all background tasks
package main
import(
"context"
"github.com/LukeHagar/plexgo"
"log"
)
func main() {
ctx := context.Background()
s := plexgo.New(
plexgo.WithSecurity("<YOUR_API_KEY_HERE>"),
)
res, err := s.Status.GetBackgroundTasks(ctx)
if err != nil {
log.Fatal(err)
}
if res.Object != nil {
// handle response
}
}{
"MediaContainer": {
"identifier": "<string>",
"offset": 123,
"size": 123,
"totalSize": 123,
"TranscodeJob": [
{
"generatorID": 123,
"key": "<string>",
"progress": 50,
"ratingKey": "<string>",
"remaining": 123,
"size": 123,
"speed": 123,
"targetTagID": 123,
"thumb": "<string>",
"title": "<string>",
"type": "transcode"
}
]
}
}The token which identifies the user accessing the PMS. This can be either:
JWT tokens provide better security with:
OK
MediaContainer is the root element of most Plex API responses. It serves as a generic container for various types of content (Metadata, Hubs, Directories, etc.) and includes pagination information (offset, size, totalSize) when applicable.
Common attributes: - identifier: Unique identifier for this container - size: Number of items in this response page - totalSize: Total number of items available (for pagination) - offset: Starting index of this page (for pagination)
The container often "hoists" common attributes from its children. For example, if all tracks in a container share the same album title, the parentTitle attribute may appear on the MediaContainer rather than being repeated on each track.
Show child attributes
The offset of where this container page starts among the total objects available. Also provided in the X-Plex-Container-Start header.
The total size of objects available. Also provided in the X-Plex-Container-Total-Size header.
Show child attributes
0 <= x <= 100The number of seconds remaining in this job
The size of the result so far
The speed of the transcode; 1.0 means real-time
The tag associated with the job. This could be the tag containing the optimizer settings.
transcode Was this page helpful?