ErsatzTV organizes all playable content through a two-level hierarchy: media sources at the top, and libraries within them. A media source represents the origin system where your media lives — a local file system, a Plex Media Server, a Jellyfin server, or an Emby server. A library is a named, scannable collection of media within that source, scoped to a particular media type such as movies, TV shows, or music videos. Understanding this distinction is important because it affects how ErsatzTV discovers content, how it keeps metadata in sync, and how it resolves file paths at playback time.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/ErsatzTV/legacy/llms.txt
Use this file to discover all available pages before exploring further.
Media Sources
A media source (MediaSource) is the root entity for any origin of content. ErsatzTV supports four kinds of media sources, defined by the MediaSourceKind enum:
| Kind | Description |
|---|---|
Local | Media stored directly on the file system where ErsatzTV is running. No authentication or network connection required. |
Plex | A Plex Media Server instance, connected via the Plex API. Requires a Plex token. |
Jellyfin | A Jellyfin server, connected via the Jellyfin HTTP API. Requires a user API key. |
Emby | An Emby server, connected via the Emby API. Requires an API key. |
Library objects representing the individual libraries defined within that source.
Libraries
A library (Library) is a named collection of media items that ErsatzTV scans and indexes. It carries:
Name— the display name shown in the UI and used when building collectionsMediaKind— the type of media the library contains (see below)LastScan— the timestamp of the most recent completed scanPaths— a list ofLibraryPathentries, each representing a root folder path to scan
Library Media Kinds
TheLibraryMediaKind enum defines what type of content a library holds:
| Kind | Value | Description |
|---|---|---|
Movies | 1 | Feature films and standalone video files treated as movies. |
Shows | 2 | TV series, organized by show → season → episode. |
MusicVideos | 3 | Music videos associated with an artist and album. |
OtherVideos | 4 | Any video content that doesn’t fit movies, shows, or music videos — home recordings, shorts, etc. |
Songs | 5 | Audio files (music tracks) used in Song playout items. |
Images | 6 | Still image files that can be used in image-based playout items. |
RemoteStreams | 7 | References to external streaming URLs treated as media items. |
Movies library and a Shows library both scanned independently.
Local Media Source
TheLocalMediaSource is a simple subtype of MediaSource with no additional properties — its libraries point directly to paths on the local file system. Path entries in a local library (LibraryPath.Path) are absolute file system paths. ErsatzTV will scan these directories recursively for supported media file types.
Local Libraries
Configure local file system paths and set up automatic scanning for media stored on the ErsatzTV host.
Plex Integration
Connect a Plex Media Server and sync libraries from your existing Plex setup.
Jellyfin Integration
Link a Jellyfin server and import its libraries into ErsatzTV for scheduling.
Emby Integration
Connect an Emby server to pull libraries and collections into ErsatzTV.
Remote Media Sources: Plex, Jellyfin, and Emby
Remote media sources extend the baseMediaSource with server-specific connection and metadata fields.
Plex (PlexMediaSource)
| Property | Description |
|---|---|
ServerName | The friendly name of the Plex Media Server. |
ProductVersion | The Plex server version string. |
Platform | The OS platform the Plex server runs on. |
PlatformVersion | The OS version. |
ClientIdentifier | The unique identifier used by ErsatzTV when authenticating with Plex. |
Connections | A list of PlexConnection entries (each has a URI and an IsActive flag). |
PathReplacements | A list of PlexPathReplacement entries for path mapping. |
LastCollectionsScan | Timestamp of the last Plex collections sync. |
Jellyfin (JellyfinMediaSource)
| Property | Description |
|---|---|
ServerName | The friendly name of the Jellyfin server. |
OperatingSystem | The OS the Jellyfin server runs on. |
Connections | A list of JellyfinConnection entries with the server URI. |
PathReplacements | A list of JellyfinPathReplacement entries. |
LastCollectionsScan | Timestamp of the last collections sync. |
Emby (EmbyMediaSource)
| Property | Description |
|---|---|
ServerName | The friendly name of the Emby server. |
OperatingSystem | The OS the Emby server runs on. |
Connections | A list of EmbyConnection entries. |
PathReplacements | A list of EmbyPathReplacement entries. |
LastCollectionsScan | Timestamp of the last collections sync. |
Path Replacements
When ErsatzTV plays back media sourced from a remote server (Plex, Jellyfin, or Emby), the server stores media at a path that reflects its own file system. If ErsatzTV is running on a different machine — or if the media is mounted at a different path — those server-side paths won’t be valid for direct file access. Path replacements solve this by mapping the server-side path prefix to the corresponding local path prefix. Example — Plex path replacement:/media/movies/The Matrix (1999)/The Matrix.mkv would be accessed locally at /mnt/nas/movies/The Matrix (1999)/The Matrix.mkv.
Each remote source type (PlexMediaSource, JellyfinMediaSource, EmbyMediaSource) carries its own PathReplacements list with source-specific fields:
| Source | Source Path Field | Local Path Field |
|---|---|---|
| Plex | PlexPath | LocalPath |
| Jellyfin | JellyfinPath | LocalPath |
| Emby | EmbyPath | LocalPath |
Scanning
ErsatzTV maintains aLastScan timestamp on each library and a LastScan on each LibraryPath. You can trigger a scan in two ways:
Manual Scan
Trigger a scan from the ErsatzTV UI on the Libraries page, or via the API. ErsatzTV will walk all registered paths, find new or changed files, and update its database.
Library Paths
EachLibrary holds a list of LibraryPath objects. A LibraryPath represents a single root directory to scan and stores:
Path— the absolute file system path of the root folderLastScan— when this specific path was last scannedMediaItems— the media items discovered under this pathLibraryFolders— the subfolder structure tracked for incremental scanning
