mirror of
https://github.com/phin05/discord-rich-presence-plex
synced 2024-11-22 01:23:02 +00:00
Added more display config properties
This commit is contained in:
parent
b0bb709423
commit
11ffb01a40
4 changed files with 17 additions and 5 deletions
|
@ -36,9 +36,12 @@ The config file is stored in a directory named `data`.
|
||||||
- `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. Applicable to movies and TV shows only.
|
||||||
- `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.
|
||||||
|
- `albumImage` (boolean, default: `true`) - Displays the album image. Applicable to music only.
|
||||||
|
- `artist` (boolean, default: `true`) - Displays the artist name. Applicable to music only.
|
||||||
|
- `artistImage` (boolean, default: `true`) - Displays the artist image. 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.
|
||||||
|
|
|
@ -16,6 +16,9 @@ config: models.config.Config = {
|
||||||
"duration": True,
|
"duration": True,
|
||||||
"genres": True,
|
"genres": True,
|
||||||
"album": True,
|
"album": True,
|
||||||
|
"albumImage": True,
|
||||||
|
"artist": True,
|
||||||
|
"artistImage": True,
|
||||||
"year": True,
|
"year": True,
|
||||||
"statusIcon": False,
|
"statusIcon": False,
|
||||||
"progressMode": "bar",
|
"progressMode": "bar",
|
||||||
|
|
11
core/plex.py
11
core/plex.py
|
@ -271,10 +271,13 @@ class PlexAlertListener(threading.Thread):
|
||||||
parent = self.server.fetchItem(item.parentRatingKey)
|
parent = self.server.fetchItem(item.parentRatingKey)
|
||||||
if parent.year:
|
if parent.year:
|
||||||
largeText = f"{truncate(largeText, 110)} ({parent.year})"
|
largeText = f"{truncate(largeText, 110)} ({parent.year})"
|
||||||
thumb = item.thumb
|
if config["display"]["albumImage"]:
|
||||||
smallText = item.originalTitle or item.grandparentTitle
|
thumb = item.thumb
|
||||||
stateStrings.append(smallText)
|
if config["display"]["artist"]:
|
||||||
smallThumb = item.grandparentThumb
|
stateStrings.append(item.originalTitle or item.grandparentTitle)
|
||||||
|
if config["display"]["artistImage"]:
|
||||||
|
smallText = item.grandparentTitle or item.originalTitle
|
||||||
|
smallThumb = item.grandparentThumb
|
||||||
else:
|
else:
|
||||||
title = shortTitle = item.title
|
title = shortTitle = item.title
|
||||||
thumb = item.thumb
|
thumb = item.thumb
|
||||||
|
|
|
@ -18,6 +18,9 @@ class Display(TypedDict):
|
||||||
duration: bool
|
duration: bool
|
||||||
genres: bool
|
genres: bool
|
||||||
album: bool
|
album: bool
|
||||||
|
albumImage: bool
|
||||||
|
artist: bool
|
||||||
|
artistImage: bool
|
||||||
year: bool
|
year: bool
|
||||||
statusIcon: bool
|
statusIcon: bool
|
||||||
progressMode: str
|
progressMode: str
|
||||||
|
|
Loading…
Reference in a new issue