@ctrl/plex
    Preparing search index...

    Class Audio

    Base class for all audio objects including Artist, Album, and Track.

    Hierarchy (View Summary)

    Index
    • Parameters

      • server: PlexServer
      • data: unknown
      • Optionalinitpath: string
      • Optionalparent: PlexObject

      Returns Audio

    _INCLUDES: {
        checkFiles: number;
        includeAllConcerts: number;
        includeBandwidths: number;
        includeChapters: number;
        includeChildren: number;
        includeConcerts: number;
        includeExternalMedia: number;
        includeExtras: number;
        includeFields: string;
        includeGeolocation: number;
        includeLoudnessRamps: number;
        includeMarkers: number;
        includeOnDeck: number;
        includePopularLeaves: number;
        includePreferences: number;
        includeRelated: number;
        includeRelatedCount: number;
        includeReviews: number;
        includeStations: number;
    } = ...
    addedAt?: Date
    art?: string
    artBlurHash?: string
    distance?: number

    Sonic distance from a seed item, used in sonically similar results.

    fields: Field[]

    List of field objects.

    guid?: string
    images: Image[]

    List of image objects.

    index?: number

    Plex index number (often the track number for tracks).

    key: string

    Plex relative url of this metadata item.

    lastRatedAt?: Date
    lastViewedAt?: Date
    librarySectionID?: number
    librarySectionKey?: string

    Key of the library section this item belongs to.

    librarySectionTitle?: string

    Title of the library section this item belongs to.

    live?: boolean

    Whether the active session is live TV.

    moods: Mood[]

    List of mood objects.

    musicAnalysisVersion?: number

    Plex music analysis version (1 indicates sonic analysis complete).

    parent?: WeakRef<PlexObject>

    WeakRef to the parent object that this object is built from.

    Client currently playing this item.

    players: PlexSessionPlayer[] = []

    Clients associated with this active playback.

    playlistItemID?: number

    Playlist item ID, only populated for items loaded from a Playlist.

    playQueueItemID?: number

    Queue-local item ID (only populated for PlayQueue items).

    ratingKey?: string
    server: PlexServer

    Bandwidth allocation for the active playback, when one exists.

    sessionKey?: number

    Server-local key for an active playback session.

    sessions: PlexPlaybackSession[] = []

    Bandwidth allocations associated with this active playback.

    summary?: string
    thumb?: string
    thumbBlurHash?: string
    title?: string
    titleSort?: string

    Title used for sorting (defaults to title).

    transcodeSession?: PlexTranscodeSession

    Active transcode associated with this playback, when Plex includes it.

    transcodeSessions: PlexTranscodeSession[] = []

    Transcodes associated with this active playback.

    type?: string
    ultraBlurColors?: UltraBlurColorsData
    updatedAt?: Date

    Account currently playing this item.

    usernames: string[] = []

    Usernames associated with this active playback.

    userRating?: number

    User rating (0.0-10.0).

    viewCount: number

    Count of times the item was played.

    viewedAt?: Date

    Datetime item was last viewed (history).

    year?: number
    METADATA_TYPE: string = 'track'

    Default metadata type for audio sync items.

    TAG: string | null = null

    xml element tag

    TYPE: string | null = null

    xml element type

    • get artUrl(): URL | undefined

      Background art URL with the token, falling back to the artist's art.

      Returns URL | undefined

    • get hasPreviewThumbnails(): boolean

      Returns boolean

    • get hasSonicAnalysis(): boolean

      Indicates if the audio item has undergone sonic analysis.

      Returns boolean

    • get hasVoiceActivity(): boolean

      Returns boolean

    • get isFullObject(): boolean

      Retruns True if this is already a full object. A full object means all attributes were populated from the api path representing only this item. For example, the search result for a movie often only contain a portion of the attributes a full object (main url) for that movie would contain.

      Returns boolean

    • get listType(): "audio"

      Hardcoded list type for filtering.

      Returns "audio"

    • get metadataDirectory(): string | undefined

      Path relative to the Plex server data directory, using server-independent separators.

      Returns string | undefined

    • get thumbUrl(): URL | undefined

      Thumbnail URL with the token, falling back to the album or artist thumbnail.

      Returns URL | undefined

    • Add a collection(s).

      Parameters

      • collections: string[]

      Returns Promise<void>

    • Add a genre(s).

      Parameters

      • genres: string[]

      Returns Promise<void>

    • Add a label(s).

      Parameters

      • labels: string[]

      Returns Promise<void>

    • Tell Plex Media Server to performs analysis on it this item to gather information. Analysis includes:

      • Gather Media Properties: All of the media you add to a Library has properties that are useful to know–whether it's a video file, a music track, or one of your photos (container, codec, resolution, etc).
      • Generate Default Artwork: Artwork will automatically be grabbed from a video file. A background image will be pulled out as well as a smaller image to be used for poster/thumbnail type purposes.
      • Generate Video Preview Thumbnails: Video preview thumbnails are created, if you have that feature enabled. Video preview thumbnails allow graphical seeking in some Apps. It's also used in the Plex Web App Now Playing screen to show a graphical representation of where playback is. Video preview thumbnails creation is a CPU-intensive process akin to transcoding the file.
      • Generate intro video markers: Detects show intros, exposing the 'Skip Intro' button in clients.

      Returns Promise<void>

    • Delete a media element. This has to be enabled under settings > server > library in plex webui.

      Returns Promise<void>

    • Edit an object.

      Parameters

      • changes: Readonly<Record<string, string | number>>

      Returns Promise<void>

    • Validate values against Plex's advertised preferences before submitting them.

      Parameters

      Returns Promise<void>

    • Set the content rating (e.g. PG-13, R, TV-MA).

      Parameters

      • contentRating: string

      Returns Promise<void>

    • Set the originally available at date (release date).

      Parameters

      • date: string

      Returns Promise<void>

    • Set the sort title.

      Parameters

      • sortTitle: string

      Returns Promise<void>

    • Set the studio.

      Parameters

      • studio: string

      Returns Promise<void>

    • Set the summary.

      Parameters

      • summary: string

      Returns Promise<void>

    • Set the title.

      Parameters

      • title: string

      Returns Promise<void>

    • Use match result to update show metadata.

      Parameters

      • options: { agent?: string; auto?: boolean; searchResult?: SearchResult } = {}

        Match options.

      Returns Promise<void>

    • Returns a stream URL that can be used for playback.

      Parameters

      • params: Readonly<StreamUrlOptions> = {}

        Additional URL parameters for transcoding options.

      Returns string

    • Parameters

      • __namedParameters: { base?: string } = {}

      Returns string

    • Returns true if this object was built from a parent of the given class.

      Parameters

      • cls: new (...args: any[]) => PlexObject

      Returns boolean

    • Whether a loaded field is locked against metadata refreshes.

      Parameters

      • name: string

      Returns boolean

    • Returns Promise<void>

    • Returns Promise<void>

    • Parameters

      • options: { agent?: string; language?: string; title?: string; year?: string } = {}

        Match options.

        Examples:

        1. video.matches()

        2. video.matches({ title: "something", year: "2020" })

        3. video.matches({ title: "something" })

        4. video.matches({ year: "2020" })

        5. video.matches({ title: "something", year: "" })

        6. video.matches({ title: "", year: "2020" })

        7. video.matches({ title: "", year: "" })

        8. The default behaviour in Plex Web = no params in plexapi

        9. Both title and year specified by user

        10. Year automatically filled in

        11. Title automatically filled in

        12. Explicitly searches for title with blank year

        13. Explicitly searches for blank title with year

        14. I don't know what the user is thinking... return the same result as 1

        For 2 to 7, the agent and language is automatically filled in

      Returns Promise<SearchResult[]>

    • Parameters

      • ratingKeys: readonly (string | number)[]

      Returns Promise<void>

    • Parameters

      • id: string

      Returns Promise<Preferences>

    • Set a personal rating from 0 to 10, or clear it with null.

      Parameters

      • rating: number | null

      Returns Promise<void>

    • Refreshing a Library or individual item causes the metadata for the item to be refreshed, even if it already has metadata. You can think of refreshing as "update metadata for the requested item even if it already has some". You should refresh a Library or individual item if:

      Returns Promise<void>

    • load full data / reload the data for this object from this.key.

      Parameters

      • Optionalekey: string
      • Optionalargs: Record<string, number | boolean>

      Returns Promise<void>

    • Remove a collection(s).

      Parameters

      • collections: string[]

      Returns Promise<void>

    • Remove a genre(s).

      Parameters

      • genres: string[]

      Returns Promise<void>

    • Remove a label(s).

      Parameters

      • labels: string[]

      Returns Promise<void>

    • Fetches a list of sonically similar audio items from the Plex server. The returned items will be instances of the same class as the current item (e.g., calling sonicallySimilar on a Track instance returns Track[]).

      Parameters

      • Optionallimit: number

        Maximum number of similar items to return. Server default is 50.

      • OptionalmaxDistance: number

        Maximum sonic distance (0.0 - 1.0) between items. Server default is 0.25.

      • Optionaloptions: Record<string, string | number>

        Optional additional filters to apply to the results.

      Returns Promise<Audio[]>

      A promise resolving to an array of sonically similar Audio items.

    • Unmatches metadata match from object.

      Returns Promise<unknown>

    • Report playback progress for this item the way a player would. Duration defaults to the item's own duration.

      Parameters

      Returns Promise<void>

    • Build an authenticated server URL for a path such as a media part key.

      Parameters

      • part: string

      Returns string | undefined