Documentation
¶
Overview ¶
Package library declares the Library value type used to represent a Plex library (Movies, TV, Music, etc.) along with the pure classification helpers (IsType, ContentTypeLabel, Build, ItemCountTypes). It depends only on the plexapi wire types; all behaviour here is deterministic and side-effect free.
Index ¶
Constants ¶
const ( TypeMovie = "movie" TypeShow = "show" TypeArtist = "artist" TypePhoto = "photo" TypeHomevideo = "homevideo" )
Library types recognised by the exporter. Values match the Plex server's "type" field on a library directory; they are part of the frozen wire/log/metric contract and must not change.
const ( TypeEpisode = "episode" TypeTrack = "track" )
Session media types observed in Plex playback notifications.
const ( PluginIdentifier = "com.plexapp.plugins.library" FeatureContent = "content" CountLabelItems = "items" )
Plex API identifiers and feature types.
const MaxLibraries = 256
MaxLibraries bounds the number of library sections the exporter tracks and emits metrics for. Like sessions.MaxTrackedSessions, it caps Prometheus label cardinality (one series set per library) against a compromised or buggy Plex server returning an unbounded list of distinct numeric section IDs in /media/providers.
Variables ¶
This section is empty.
Functions ¶
func ContentTypeLabel ¶
ContentTypeLabel returns the plural noun used as the "content_type" Prometheus label for libraries of libType.
func ItemCountTypes ¶
ItemCountTypes returns the Plex metadata-type IDs to try in order for the given library type's item count. 0 means no type filter (the default path), matching plexapi.ContainerTotalSize's contract.