plexapi

package
v2.2.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 27, 2026 License: GPL-2.0, GPL-3.0 Imports: 1 Imported by: 0

Documentation

Overview

Package plexapi declares the JSON wire-format types exchanged with Plex Media Server's HTTP API. It is a pure-data package with no imports beyond encoding/json tag use.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MediaInfo

type MediaInfo struct {
	VideoResolution string      `json:"videoResolution"`
	Part            []MediaPart `json:"Part"`
	Bitrate         int         `json:"bitrate"`
}

MediaInfo describes the Media element attached to a session.

type MediaPart

type MediaPart struct {
	Decision string `json:"decision"`
}

MediaPart describes a single part of a Media entry (video/audio stream decision).

type SessionMetadata

type SessionMetadata struct {
	TranscodeSession *WSTranscodeSession `json:"TranscodeSession"`
	User             struct {
		Title string `json:"title"`
	} `json:"User"`
	GrandparentTitle string      `json:"grandparentTitle"`
	ParentTitle      string      `json:"parentTitle"`
	Title            string      `json:"title"`
	Type             string      `json:"type"`
	LibrarySectionID json.Number `json:"librarySectionID"`
	SessionKey       string      `json:"sessionKey"`
	RatingKey        string      `json:"ratingKey"`
	Player           struct {
		Device  string `json:"device"`
		Product string `json:"product"`
		State   string `json:"state"`
		Local   bool   `json:"local"`
	} `json:"Player"`
	Session struct {
		Location  string `json:"location"`
		Bandwidth int    `json:"bandwidth"`
	} `json:"Session"`
	Media []MediaInfo `json:"Media"`
	Index int         `json:"index"`
}

SessionMetadata models an entry in /status/sessions or in /library/metadata/<id>.

type WSTranscodeSession

type WSTranscodeSession struct {
	VideoDecision    string `json:"videoDecision"`
	AudioDecision    string `json:"audioDecision"`
	SubtitleDecision string `json:"subtitleDecision"`
	SourceVideoCodec string `json:"sourceVideoCodec"`
	SourceAudioCodec string `json:"sourceAudioCodec"`
	VideoCodec       string `json:"videoCodec"`
	AudioCodec       string `json:"audioCodec"`
}

WSTranscodeSession is a TranscodeSession element embedded in the /status/sessions response (nested under each Video entry). The classification functions in package sessions use its decision fields to derive the transcode_type and subtitle_action Prometheus labels. The "WS" prefix is historical (the struct originated from the websocket notification path); it is kept to avoid a rename-churn across consumers.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL