Writes a movie's edition title through the Plex HTTP API.
Edition 功能的思路受 edition-manager-for-plex 启发(MIT)。
EDITION_MODULES sets the order. A module with no value is omitted. The rest are joined with EDITION_SEPARATOR (· when unset).
| Module | Config name | Text |
|---|---|---|
| source | 片源版本 | REMUX, BD, WEB-DL |
| cut | 剪辑版本 | Director's Cut / 导演剪辑版 |
| release | 发行版本 | IMAX Edition / IMAX 版 |
| resolution | 分辨率 | 4K, 1080P |
| dynamicrange | 动态范围 | HDR, DV P7, HDR · DV P7, SDR |
| videocodec | 视频编码 | HEVC |
| framerate | 帧率 | 24P |
| audiocodec | 音频编码 | TRUEHD 7.1 |
| bitrate | 比特率 | 8.5 Mbps; under 1 Mbps, 800 Kbps |
| size | 大小 | 20.00 GB |
| country | 国家 | United States / 美国 |
| contentrating | 内容分级 | PG-13; Not Rated becomes NR |
| rating | 评分 | 8.2 |
| duration | 时长 | 120 MIN / 120 分钟 |
source, cut, and release read the largest file's name, then the embedded video title. release keeps every match. A .strm name usually matches none of the three. The other modules read that file's Plex metadata.
An existing edition is left unchanged. reset clears every non-empty edition in movie libraries, including one entered by hand, and unlocks the field.
PLEX_URL=http://127.0.0.1:32400
PLEX_TOKEN=
PLEX_CONFIG_DIR=
EDITION_MODULES=source;resolution;dynamicrange
EDITION_LANG=zh
EDITION_SKIP_LIBRARIES=
EDITION_SEPARATOR= ·
EDITION_MODULES and EDITION_SKIP_LIBRARIES split on ; or ;. EDITION_LANG is en, zh, zh-TW, ja, ko, ar, fr, ru, or es. Shows are not included. Labels live in locales/edition.json.
Leave PLEX_TOKEN empty to read PlexOnlineToken from Preferences.xml under PLEX_CONFIG_DIR. When that is unset, the file is read from /config/Library/Application Support/Plex Media Server, which is where compose.yaml mounts the Plex data directory. A token set in the environment is used as given.
editions all --dry-run
editions all
editions reset
editions new
all and reset exit when the libraries are done. new stays up: before it connects, and again 30 minutes after the socket drops, it writes editions for movies that do not have one, then listens. A movie scanned while it is listening is written as Plex reports it. The same 30 minutes applies while the token cannot be read or the server does not answer, so the container can start before Plex is claimed or up.
PLEX_URL has to be reachable from the container. 127.0.0.1 points at the container itself unless it shares the host network.