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:
Each media source holds a list of
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:
A single media source can contain multiple libraries of different kinds. For example, a Plex server might have a
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)
Jellyfin (JellyfinMediaSource)
Emby (EmbyMediaSource)
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:
Scanning
ErsatzTV maintains aLastScan timestamp on each library and a LastScan on each LibraryPath. You can trigger a scan in two ways:
1
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.
2
Automatic Periodic Scan
ErsatzTV can be configured to run library scans automatically at a regular interval. This keeps the database in sync without manual intervention, especially useful when media is frequently added to local folders or synced from remote servers.
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
