Skip to content

Configuration

danrahn edited this page Oct 7, 2024 · 15 revisions

Configuring Marker Editor

First Run

The first time you use Marker Editor, the application should automatically launch a browser tab, taking you to the server settings dialog:

First run configuration dialog

Client-side server configuration

 

You can hover over the question mark icon to get more information about what each specific setting controls, or see the descriptions below.

Edit the settings as necessary (in many cases, the default values will be enough to get started with Marker Editor), and click "Apply". If all values are valid, you should see a "Settings applied" message, and clicking reload or refreshing the page should take you to the editor.

If you are not able to access a browser on the machine running Marker Editor, you have a couple options:

  • Start Marker Editor with --cli-setup. This will force Marker Editor to enter the command-line setup mode. See CLI Fallback.
  • Manually create config.json in the root directory of this application. See Config.json.

CLI Fallback

If you cannot access the default host:port (http://localhost:3232), or prefer CLI setup, you can instead use the CLI setup wizard. To do this, start the application with --cli-setup (e.g. node app.js --cli-setup if running from source, ./MarkerEditor --cli-setup for Unix-based operating systems, or .\MarkerEditor.exe --cli-setup on Windows).

Click to view example --cli-setup output
Welcome to Marker Editor for Plex! It looks like this is your first run, as config.json
could not be found. Would you like to go through the first-time setup [y/n]? (default: y):

During this initial setup, you'll be asked a series of configuration questions. If a default
is available, it will be provided in parentheses, and pressing 'Enter' will select that value.

If you are asked to provide a path, provide it without quotes or other escaped characters.

NOTE: the user account running this program must have read access to the database to view
      markers, and write access to add, edit, or delete markers.

For more information about what these settings control, see https://github.com/danrahn/MarkerEditorForPlex/wiki/Configuration

Press Enter to continue to configuration (Ctrl+C to cancel at any point):

Plex data directory path (default: auto, -1 to skip): P:\Plex\Plex Media Server
Plex database path (default: auto, -1 to skip):
Editor host (default: localhost): 192.168.1.2
Editor port (default: 3232):
Server log level (see wiki for available values) (default: Info): DarkVerbose
Do you want to require a username/password to access this application [y/n]? (default: n): y
Session timeout (default: 86400): 
Username: MyCoolUsername
Password: **********
Confirm password: **********
Do you want the app to open in the browser automatically [y/n]? (default: y): n
Do you want to display extended marker statistics [y/n]? (default: y):
Do you want to view preview thumbnails when editing markers [y/n]? (default: y):

Preview thumbnails can use either Plex's generated thumbnails or generate them
on-the-fly with ffmpeg. While Plex's thumbnails can be retrieved much faster
and use fewer resources, they are far less accurate, and are not available if
they are disabled in your library.
Do you want to use Plex's generated thumbnails (y), or ffmpeg (n) [y/n]? (default: y): n

Path Mappings:
If you're running Marker Editor and Plex Media Server on different devices, file paths
may be different between this machine and what's in Plex's database. If so, FFmpeg
generated thumbnails won't work. However, you can specify path mappings below to replace
path prefixes (e.g. replace 'Z:\Media\Movies' with '/mnt/Media/Movies').

NOTE: Path mappings are case-sensitive.

Do you want to add a path mapping [y/n]? (default: n): y
Map from: /mnt/data
Map to: Z:\
WARN: 'from' path does not end with a path separator, but
      'to' path does. Is that intentional?
Confirm mapping from '/mnt/data' to 'Z:\' [y/n]? (default: y):
Mapping added!
Do you want to add another path mapping [y/n]? (default: n):

Main Settings

If you don't go through the first-run steps, or want to tweak your configuration after the fact, open (or create) config.json in a text editor, and set the following fields if different from the default:

Data Path

dataPath in config.json. This is the full path to the Plex data directory. This is only necessary if the application can't find the data directory automatically. It's also optional if previewThumbnails are disabled. Note that for Windows paths, backslashes (\) must be escaped, e.g. "C:\\Path\\To\\Plex Media Server".


Database File

database in config.json. The full path to the Plex database. If a folder is provided, the application will look for com.plexapp.plugins.library.db within that folder. By default, looks in Plug-in Support/Databases within the Plex data directory. Optional if dataPath is supplied, or dataPath is found automatically by the application. Providing an explicit path can be useful for testing if you want to run this application on a copy of your database before running it against the real thing.


Listen Host

host in config.json. The hostname Node will listen on. Defaults to localhost, but could be changed to e.g. the machine's LAN IP if you want to modify markers on a different device on your local network. Note that this application has no authentication/safeguards, so be careful about how widely you expose the application.


Listen Port

port in config.json. The port the server will listen on. Defaults to 3232. Must be between 1 and 65535 (inclusive). A value greater than 1024 is highly recommended.


Log Level

logLevel in config.json. Determines the level of logging to the console, both server- and client-side. Valid values are TMI, Verbose, Info, Warn, and Error, with a default of Info (i.e. show only Info and higher messages). Output is color-coded for consoles that support it, so Dark can be prefixed to any log level option to force a dark themed color scheme if it can't be detected automatically (e.g. DarkVerbose).


Authentication

authentication in config.json. A dictionary of authentication related settings, as outlined below.

If enabled, note that config.json is not used to store the username/password, so adding those fields to config.json will have no effect. Your username and (hashed) password are stored in auth.db, which lives in this application's Backup directory.

Features

features in config.json. A dictionary of toggleable settings, as outlined below.


Path Mappings

pathMappings in config.json. An array of "from"/"to" mappings that will be used if preciseThumbnails are enabled. This is useful if you're running Marker Editor on a different machine than your Plex Server, file paths aren't the same between them, and you still want to use FFMpeg-based thumbnails.

See an example scenario below.

Authentication Settings

Enabled

enabled in config.json. If true, require a username and password to access the application. If not provided, defaults to false.

sessionTimeout

sessionTimeout in config.json. The number of seconds of inactivity before an authenticated session is destroyed. Must be at least 300 seconds (5 minutes). If not provided, defaults to one day (86400).

Feature Settings

Open Browser on Launch

autoOpen in config.json. If true, automatically opens the application in your default browser after startup. If not provided, defaults to true.


Extended Marker Statistics

extendedMarkerStats in config.json. Gathers statistics about all markers in the database on startup to compile per library/show/season marker data. It's recommended to keep this enabled, but can increase boot time and memory footprint with large libraries.


Use Preview Thumbnails

previewThumbnails in config.json. Determines whether the application should retrieve preview thumbnails when adding/editing markers to give a visual guide of where you are in a video. If enabled (the default), the retrieval method depends on preciseThumbnails below.


Use FFmpeg for Thumbnails

preciseThumbnails in config.json. Determines how to retrieve preview thumbnails if previewThumbnails is enabled:

  • If false (the default), attempts to use the video preview thumbnails that Plex generates to retrieve the thumbnail closest to the current timestamp. This won't work if preview thumbnails are disabled for a library, and its usefulness decreases if you've increased GenerateBIFFrameInterval. It is also less useful if your media has a high keyframe interval and GenerateBIFKeyframesOnly is set to the default of true, as the gap between thumbnails widens, making it harder to pinpoint a specific point in time within the editor.
  • If true, uses ffmpeg to generate thumbnails on-the-fly, with 100ms accuracy. While much more accurate than the option above, it requires ffmpeg to be in your path, and can take significantly more time to generate versus the near immediate retrieval of the pre-generated preview thumbnails.

Note: preciseThumbnails has not been tested in a Docker environment, so support (or lack thereof) is provided as-is. It should work in theory as long as ffmpeg is available and media paths are identical, but as mentioned, it is untested.


Config.json

The editor's settings are saved to config.json alongside the main program. While these settings can be configured in the browser or via --cli-setsup, config.json can also be edited directly. An example configuration can be found in config.example.json. All fields have default values as outlined below, so a minimal config.json could simple be the empty {}:

{
    "dataPath" : "/optional/path/to/data/directory",
    "database" : "/optional/path/to/com.plexapp.plugins.library.db",
    "host" : "localhost",
    "port" : 3232,
    "logLevel" : "DarkInfo",
    "features" : {
        "autoOpen" : true,
        "extendedMarkerStats" : true,
        "previewThumbnails" : true,
        "preciseThumbnails" : false
    },
    "pathMappings": [
        {
            "from": "Z:\\",
            "to": "/mnt/data"
        }
    ]
}

Docker

Configuration is slightly different in Docker. Instead of config.json, three values are instead provided in the docker run command:

docker run -p 3233:3232 \
           -v /path/to/config:/Data \
           -v /path/to/PlexData:/PlexDataDirectory \
           -it danrahn/intro-editor-for-plex:latest
  • -p port:3232, where port is the external port used to access the web app (not 3232). Overrides config.json's port.
  • -v /path/to/config:/Data, where /path/to/config is the local directory you want to use to store your configuration and backup database.
  • -v /path/to/PlexData:/PlexDataDirectory, where /path/to/PlexData is the path to the Plex Data Directory. Overrides both dataPath and database in config.json.
  • config.json's host is ignored, overridden with 0.0.0.0.

Examples

Minimal

Let the application figure out where the Plex data directory/database is, and use the defaults outlined above. The application will print an error message to the console and fail to start if it isn't able to automatically determine the data path's location.

{}

"Safe mode"

Point to a copy of your database, and disable preview thumbnails to avoid reading into the data directory. This would allow you to view existing markers (without thumbnails) and keep Plex running:

{
    "database" : "/path/to/com.plexapp.plugins.library.copy.db",
    "features" : {
        "previewThumbnails" : false
    }
}

Custom database

If you don't want to run this application on your Plex database directly, but still want to make use of preview thumbnails, you can specify a custom database path:

{
    "database" : "C:\\Test\\com.plexapp.plugins.library.db",
    "features" : {
        "previewThumbnails" : true
    }
}

Custom Path Mappings

If your server is running on Windows and you have two networked media drives, Y:\ and Z:\, but you're running Marker Editor on a Linux machine with your media mounted under /mnt/data1 and /mnt/data2, the following would ensure the database's Windows-based paths are converted to paths that are available on your Linux machine, allowing FFMpeg-based thumbnails to still work:

{
    "database" : "/path/to/com.plexapp.plugins.library.db",
    "features" : {
        "previewThumbnails" : true,
        "preciseThumbnails" : true
    },
    "pathMappings" : [
        {
            "from" : "Y:\\",
            "to" : "/mnt/data1/"
        },
        {
            "from" : "Z:\\",
            "to" : "/mnt/data2/"
        }
    ]
}

Various Adjustments

The following example

  • Sets a custom Plex data path
  • Uses the machine's LAN IP address to allow other devices on the local network to access the web application
  • Logs as much information as possible to the console ("Too Much Information")
  • Disables auto-open on boot
  • Disables preview thumbnails
{
    "dataPath" : "P:\\Plex\\Plex Media Server",
    "host" : "192.168.0.10",
    "logLevel" : "TMI",
    "features" : {
        "autoOpen" : false,
        "previewThumbnails" : false,
    }
}
Clone this wiki locally