Class Episode

Hierarchy

  • Video
    • Episode

Constructors

  • Parameters

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

    Returns Episode

Properties

METADATA_TYPE: string = 'episode'
TYPE: string = 'episode'
_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

Datetime this item was added to the library.

art?: string
artBlurHash?: string

BlurHash string for artwork image.

chapterSource?: string

Unknown (media).

chapters: Chapter[]
collections: Collection[]
contentRating: string

Content rating (PG-13; NR; TV-G).

directors: Director[]
duration: number

Duration of episode in milliseconds.

grandparentArt?: string
grandparentKey: string

Key to this episodes :class:~plexapi.video.Show.

grandparentRatingKey: string

Unique key for this episodes :class:~plexapi.video.Show.

grandparentTheme: string

Key to this episodes :class:~plexapi.video.Show theme.

grandparentThumb: string

Key to this episodes :class:~plexapi.video.Show thumb.

grandparentTitle: string

Title of this episodes :class:~plexapi.video.Show.

guid: string

Plex GUID (com.plexapp.agents.imdb://tt4302938?lang=en).

index: number

Episode number.

key: string

plex relative url

lastViewedAt?: Date

Datetime item was last accessed.

librarySectionID?: number
listType: "video" = ...

Hardcoded as 'video' (useful for search filters).

markers: Marker[]
media: Media[]
originallyAvailableAt: Date

Datetime episode was released.

parent?: WeakRef<any>

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

parentIndex: number

Season number of episode.

parentKey: string

Key to this episodes :class:~plexapi.video.Season.

parentRatingKey: string

Unique key for this episodes :class:~plexapi.video.Season.

parentThumb: string

Key to this episodes thumbnail.

parentTitle: string

Name of this episode's season

players: any

(:class:~plexapi.client.PlexClient): Client objects playing this item (for active sessions).

playlistItemID?: number

(int): Playlist item ID (only populated for :class:~plexapi.playlist.Playlist items).

rating: number

Movie rating (7.9; 9.8; 8.1).

ratingKey?: string
server: PlexServer
session: any

(:class:~plexapi.media.Session): Session object, for a playing media file.

sessionKey: any

(int): Active session key.

summary: string

Summary of the artist, track, or album.

thumb: string

URL to thumbnail image.

thumbBlurHash?: string

BlurHash string for thumbnail image.

title?: string
titleSort?: string

Title to use when sorting (defaults to title).

transcodeSessions: any

(:class:~plexapi.media.TranscodeSession): Transcode Session object if item is being transcoded (None otherwise).

type?: string
updatedAt?: Date

Datetime this item was updated.

usernames: any

(str): Username of the person playing this item (for active sessions).

viewCount?: number

Count of times this item was accessed.

viewOffset?: number

View offset in milliseconds.

viewedAt: any

(datetime): Datetime item was last viewed (history).

writers: Writer[]
year?: number
TAG: string = 'Video'

xml element tag

TYPE: string = null

xml element type

Accessors

  • get artUrl(): URL
  • Returns URL

  • 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 isWatched(): boolean
  • Returns True if this video is watched.

    Returns boolean

  • get thumbUrl(): URL
  • Return the first first thumbnail url starting on the most specific thumbnail for that item.

    Returns URL

Methods

  • 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<any>

  • Edit an object.

    Parameters

    • changeObj: Record<string, string | number>

      Obj of settings to edit. Example: {'type': 1, 'id': movie.ratingKey, 'title.value': 'New Title', 'collection[0].tag.tag': 'Super', 'collection.locked': 0}

    Returns Promise<void>

  • Returns Promise<Extra[]>

  • Use match result to update show metadata.

    Parameters

    • OptionalsearchResult: SearchResult

      Search result

    • auto: boolean = false

      True uses first match from matches, False allows user to provide the match

    • agent: string = ''

      (str): Agent name to be used (imdb, thetvdb, themoviedb, etc.)

    Returns Promise<void>

  • Parameters

    • Optionalbase: string

    Returns string

  • Returns True if this episode has a credits marker

    Returns Promise<boolean>

  • Returns True if this episode has an intro marker

    Returns Promise<boolean>

  • Get Play History for a media item.

    Parameters

    • maxresults: number = 9999999

      Only return the specified number of results (optional).

    • Optionalmindate: Date

      Min datetime to return results from.

    Returns Promise<HistoryMetadatum[]>

  • Returns True if this object is a child of the given class.

    Parameters

    • cls: any

    Returns boolean

  • Returns string[]

  • Mark video as unwatched.

    Returns Promise<void>

  • Mark video as watched.

    Returns Promise<void>

  • Parameters

    • Optionalagent: string

      Agent name to be used (imdb, thetvdb, themoviedb, etc.)

    • Optionaltitle: string

      Title of item to search for

    • Optionalyear: string

      Year of item to search in

    • Optionallanguage: string

      Language of item to search in

      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[]>

  • Returns list of available Poster objects.

    Returns Promise<Poster[]>

  • Parameters

    • rate: number

    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: any

    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>

  • Returns Promise<Season>

  • Returns Promise<string>

  • Returns this episodes season number.

    Returns Promise<number>

  • Returns Promise<Section>

  • Set the poster for a Plex object.

    Parameters

    • poster: Poster

      The poster object to select.

    Returns Promise<Episode>

  • Returns Promise<Show>

  • Unmatches metadata match from object.

    Returns Promise<any>

  • I haven't tested this yet. It may not work.

    Parameters

    • Optionalurl: string
    • Optionalfile: Uint8Array

    Returns Promise<void>