mirror of
https://github.com/phin05/discord-rich-presence-plex
synced 2024-11-22 01:23:02 +00:00
Cleanup
This commit is contained in:
parent
4b41a2308d
commit
b0bb709423
4 changed files with 50 additions and 49 deletions
|
@ -4,7 +4,7 @@
|
||||||
.gitignore
|
.gitignore
|
||||||
CONTRIBUTING.md
|
CONTRIBUTING.md
|
||||||
Dockerfile
|
Dockerfile
|
||||||
lint.bat
|
Makefile
|
||||||
pyrightconfig.json
|
pyrightconfig.json
|
||||||
|
|
||||||
__pycache__
|
__pycache__
|
||||||
|
|
3
Makefile
Normal file
3
Makefile
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
default:
|
||||||
|
lint:
|
||||||
|
pyright --pythonversion 3.10.0
|
92
README.md
92
README.md
|
@ -27,38 +27,38 @@ The config file is stored in a directory named `data`.
|
||||||
|
|
||||||
### Supported Formats
|
### Supported Formats
|
||||||
|
|
||||||
* YAML - `config.yaml` / `config.yml`
|
- YAML - `config.yaml` / `config.yml`
|
||||||
* JSON - `config.json`
|
- JSON - `config.json`
|
||||||
|
|
||||||
### Reference
|
### Reference
|
||||||
|
|
||||||
* `logging`
|
- `logging`
|
||||||
* `debug` (boolean, default: `true`) - Outputs additional debug-helpful information to the console.
|
- `debug` (boolean, default: `true`) - Outputs additional debug-helpful information to the console.
|
||||||
* `writeToFile` (boolean, default: `false`) - Writes console output to a `console.log` file in the `data` directory.
|
- `writeToFile` (boolean, default: `false`) - Writes console output to a `console.log` file in the `data` directory.
|
||||||
* `display` - Display settings for Rich Presence
|
- `display` - Display settings for Rich Presence
|
||||||
* `duration` (boolean, default: `true`) - Displays the total duration.
|
- `duration` (boolean, default: `true`) - Displays the total duration.
|
||||||
* `genres` (boolean, default: `true`) - Displays the genre. Applicable to movies only.
|
- `genres` (boolean, default: `true`) - Displays the genre. Applicable to movies only.
|
||||||
* `album` (boolean, default: `true`) - Displays the album name. Applicable to music only.
|
- `album` (boolean, default: `true`) - Displays the album name. Applicable to music only.
|
||||||
* `year` (boolean, default: `true`) - Displays the release year.
|
- `year` (boolean, default: `true`) - Displays the release year.
|
||||||
* `statusIcon` (boolean, default: `false`) - Displays a status icon (playing, paused, buffering) at the bottom-right corner of the poster. Applicable to movies and TV shows only. Posters get cropped to a square if this is enabled (Discord bug/limitation).
|
- `statusIcon` (boolean, default: `false`) - Displays a status icon (playing, paused, buffering) at the bottom-right corner of the poster. Applicable to movies and TV shows only. Posters get cropped to a square if this is enabled (Discord bug/limitation).
|
||||||
* `progressMode` (string, default: `bar`) - Progress/timestamp display mode. Valid modes are `off`, `elapsed` (displays elapsed time), `remaining` (displays remaining time) and `bar` (displays a progress bar). The `off` and `remaining` modes are currently broken due to a Discord bug/limitation.
|
- `progressMode` (string, default: `bar`) - Progress/timestamp display mode. Valid modes are `off`, `elapsed` (displays elapsed time), `remaining` (displays remaining time) and `bar` (displays a progress bar). The `off` and `remaining` modes are currently broken due to a Discord bug/limitation.
|
||||||
* `paused` (boolean, default: `false`) - Displays Rich Presence even while media is paused. Progress/timestamp display while paused is currently broken due to a Discord bug/limitation.
|
- `paused` (boolean, default: `false`) - Displays Rich Presence even while media is paused. Progress/timestamp display while paused is currently broken due to a Discord bug/limitation.
|
||||||
* `posters`
|
- `posters`
|
||||||
* `enabled` (boolean, default: `false`) - Displays media posters (including album art and artist images). Requires `imgurClientID`.
|
- `enabled` (boolean, default: `false`) - Displays media posters (including album art and artist images). Requires `imgurClientID`.
|
||||||
* `imgurClientID` (string, default: `""`) - [Obtention Instructions](#obtaining-an-imgur-client-id)
|
- `imgurClientID` (string, default: `""`) - [Obtention Instructions](#obtaining-an-imgur-client-id)
|
||||||
* `maxSize` (int, default: `256`) - Maximum width and maximum height to use while downscaling posters before uploading them.
|
- `maxSize` (int, default: `256`) - Maximum width and maximum height to use while downscaling posters before uploading them.
|
||||||
* `buttons` (list) - [Information](#buttons)
|
- `buttons` (list) - [Information](#buttons)
|
||||||
* `label` (string) - The label to be displayed on the button.
|
- `label` (string) - The label to be displayed on the button.
|
||||||
* `url` (string) - A web address or a [dynamic URL placeholder](#dynamic-button-urls).
|
- `url` (string) - A web address or a [dynamic URL placeholder](#dynamic-button-urls).
|
||||||
* `mediaTypes` (list, optional) - If set, the button is displayed only for the specified media types. Valid media types are `movie`, `episode`, `live_episode`, `track` and `clip`.
|
- `mediaTypes` (list, optional) - If set, the button is displayed only for the specified media types. Valid media types are `movie`, `episode`, `live_episode`, `track` and `clip`.
|
||||||
* `users` (list)
|
- `users` (list)
|
||||||
* `token` (string) - An access token associated with your Plex account. ([X-Plex-Token](https://support.plex.tv/articles/204059436-finding-an-authentication-token-x-plex-token/), [Authenticating with Plex](https://forums.plex.tv/t/authenticating-with-plex/609370))
|
- `token` (string) - An access token associated with your Plex account. ([X-Plex-Token](https://support.plex.tv/articles/204059436-finding-an-authentication-token-x-plex-token/), [Authenticating with Plex](https://forums.plex.tv/t/authenticating-with-plex/609370))
|
||||||
* `servers` (list)
|
- `servers` (list)
|
||||||
* `name` (string) - Name of the Plex Media Server to connect to.
|
- `name` (string) - Name of the Plex Media Server to connect to.
|
||||||
* `listenForUser` (string, optional) - The script reacts to alerts originating only from this username. Defaults to the parent user's username if not set.
|
- `listenForUser` (string, optional) - The script reacts to alerts originating only from this username. Defaults to the parent user's username if not set.
|
||||||
* `blacklistedLibraries` (list, optional) - Alerts originating from libraries in this list are ignored.
|
- `blacklistedLibraries` (list, optional) - Alerts originating from libraries in this list are ignored.
|
||||||
* `whitelistedLibraries` (list, optional) - If set, alerts originating from libraries that are not in this list are ignored.
|
- `whitelistedLibraries` (list, optional) - If set, alerts originating from libraries that are not in this list are ignored.
|
||||||
* `ipcPipeNumber` (int, optional) - A number in the range of `0-9` to specify the Discord IPC pipe to connect to. Defaults to `-1`, which specifies that the first existing pipe in the range should be used. When a Discord client is launched, it binds to the first unbound pipe number, which is typically `0`.
|
- `ipcPipeNumber` (int, optional) - A number in the range of `0-9` to specify the Discord IPC pipe to connect to. Defaults to `-1`, which specifies that the first existing pipe in the range should be used. When a Discord client is launched, it binds to the first unbound pipe number, which is typically `0`.
|
||||||
|
|
||||||
### Obtaining an Imgur client ID
|
### Obtaining an Imgur client ID
|
||||||
|
|
||||||
|
@ -78,12 +78,12 @@ Instances of `{title}` in button labels will be replaced with the top-level titl
|
||||||
|
|
||||||
During runtime, the following dynamic URL placeholders will get replaced with real URLs based on the media being played:
|
During runtime, the following dynamic URL placeholders will get replaced with real URLs based on the media being played:
|
||||||
|
|
||||||
* `dynamic:imdb`
|
- `dynamic:imdb`
|
||||||
* `dynamic:tmdb`
|
- `dynamic:tmdb`
|
||||||
* `dynamic:thetvdb`
|
- `dynamic:thetvdb`
|
||||||
* `dynamic:trakt`
|
- `dynamic:trakt`
|
||||||
* `dynamic:letterboxd`
|
- `dynamic:letterboxd`
|
||||||
* `dynamic:musicbrainz`
|
- `dynamic:musicbrainz`
|
||||||
|
|
||||||
### Example (YAML)
|
### Example (YAML)
|
||||||
|
|
||||||
|
@ -104,7 +104,7 @@ display:
|
||||||
imgurClientID: 9e9sf637S8bRp4z
|
imgurClientID: 9e9sf637S8bRp4z
|
||||||
maxSize: 256
|
maxSize: 256
|
||||||
buttons:
|
buttons:
|
||||||
- label: '{title} on IMDb'
|
- label: "{title} on IMDb"
|
||||||
url: dynamic:imdb
|
url: dynamic:imdb
|
||||||
- label: Music Stats
|
- label: Music Stats
|
||||||
url: https://github.com
|
url: https://github.com
|
||||||
|
@ -127,8 +127,8 @@ The "Share your detected activities with others" setting must be enabled under D
|
||||||
|
|
||||||
## Configuration - Environment Variables
|
## Configuration - Environment Variables
|
||||||
|
|
||||||
* `DRPP_PLEX_SERVER_NAME_INPUT` - This is used only during the initial setup (when there are no users in the config) as the name of the Plex server to be added to the config file after user authentication. If this isn't set, in interactive environments, the user is prompted for an input, and in non-interactive environments, "ServerName" is used as a placeholder, which can later be changed by editing the config file and restarting the script.
|
- `DRPP_PLEX_SERVER_NAME_INPUT` - This is used only during the initial setup (when there are no users in the config) as the name of the Plex server to be added to the config file after user authentication. If this isn't set, in interactive environments, the user is prompted for an input, and in non-interactive environments, "ServerName" is used as a placeholder, which can later be changed by editing the config file and restarting the script.
|
||||||
* `DRPP_NO_PIP_INSTALL` - Set this to `true` to skip automatic invocation of pip on script startup to install missing dependencies.
|
- `DRPP_NO_PIP_INSTALL` - Set this to `true` to skip automatic invocation of pip on script startup to install missing dependencies.
|
||||||
|
|
||||||
## Run with Docker
|
## Run with Docker
|
||||||
|
|
||||||
|
@ -138,10 +138,10 @@ The "Share your detected activities with others" setting must be enabled under D
|
||||||
|
|
||||||
Images are available for the following platforms:
|
Images are available for the following platforms:
|
||||||
|
|
||||||
* linux/amd64
|
- linux/amd64
|
||||||
* linux/arm64
|
- linux/arm64
|
||||||
* linux/386
|
- linux/386
|
||||||
* linux/arm/v7
|
- linux/arm/v7
|
||||||
|
|
||||||
### Volumes
|
### Volumes
|
||||||
|
|
||||||
|
@ -149,10 +149,10 @@ Mount a directory for persistent data (config file, cache file and log file) at
|
||||||
|
|
||||||
The runtime directory where Discord stores its inter-process communication Unix socket file needs to be mounted into the container at `/run/app`. The path for this would be the first non-null value from the values of the following environment variables in the environment Discord is running in: ([source](https://github.com/discord/discord-rpc/blob/963aa9f3e5ce81a4682c6ca3d136cddda614db33/src/connection_unix.cpp#L29C33-L29C33))
|
The runtime directory where Discord stores its inter-process communication Unix socket file needs to be mounted into the container at `/run/app`. The path for this would be the first non-null value from the values of the following environment variables in the environment Discord is running in: ([source](https://github.com/discord/discord-rpc/blob/963aa9f3e5ce81a4682c6ca3d136cddda614db33/src/connection_unix.cpp#L29C33-L29C33))
|
||||||
|
|
||||||
* XDG_RUNTIME_DIR
|
- XDG_RUNTIME_DIR
|
||||||
* TMPDIR
|
- TMPDIR
|
||||||
* TMP
|
- TMP
|
||||||
* TEMP
|
- TEMP
|
||||||
|
|
||||||
If all four environment variables aren't set, `/tmp` is used.
|
If all four environment variables aren't set, `/tmp` is used.
|
||||||
|
|
||||||
|
|
2
lint.bat
2
lint.bat
|
@ -1,2 +0,0 @@
|
||||||
@echo off
|
|
||||||
pyright --pythonversion 3.10.0
|
|
Loading…
Reference in a new issue