mirror of
https://github.com/phin05/discord-rich-presence-plex
synced 2024-11-24 10:33:03 +00:00
Added config option to hide media's total duration
This commit is contained in:
parent
1792552745
commit
b66eae9b6b
5 changed files with 10 additions and 6 deletions
10
README.md
10
README.md
|
@ -4,7 +4,7 @@
|
|||
|
||||
A Python script that displays your [Plex](https://www.plex.tv/) status on [Discord](https://discord.com/) using [Rich Presence](https://discord.com/developers/docs/rich-presence/how-to).
|
||||
|
||||
Current Version: 2.3.0
|
||||
Current Version: 2.3.1
|
||||
|
||||
## Getting Started
|
||||
|
||||
|
@ -26,10 +26,11 @@ The script must be running on the same machine as your Discord client.
|
|||
* `logging`
|
||||
* `debug` (boolean, default: `true`) - Outputs additional debug-helpful information to the console if enabled.
|
||||
* `writeToFile` (boolean, default: `false`) - Writes everything outputted to the console to a `console.log` file if enabled.
|
||||
* `display`
|
||||
* `useRemainingTime` (boolean, default: `false`) - Displays your media's remaining time instead of elapsed time in your Rich Presence if enabled.
|
||||
* `display` - Display settings for Rich Presence
|
||||
* `hideTotalTime` (boolean, default: `false`) - Hides the total duration of the media if enabled.
|
||||
* `useRemainingTime` (boolean, default: `false`) - Displays the media's remaining time instead of elapsed time if enabled.
|
||||
* `posters`
|
||||
* `enabled` (boolean, default: `false`) - Displays media posters in Rich Presence if enabled. Requires `imgurClientID`.
|
||||
* `enabled` (boolean, default: `false`) - Displays media posters if enabled. Requires `imgurClientID`.
|
||||
* `imgurClientID` (string, default: `""`) - [Obtention Instructions](#obtaining-an-imgur-client-id)
|
||||
* `buttons` (list) - [Information](#buttons)
|
||||
* `label` (string) - The label to be displayed on the button.
|
||||
|
@ -69,6 +70,7 @@ During runtime, the following dynamic URL placeholders will get replaced with re
|
|||
"writeToFile": false
|
||||
},
|
||||
"display": {
|
||||
"hideTotalTime": false,
|
||||
"useRemainingTime": false,
|
||||
"posters": {
|
||||
"enabled": true,
|
||||
|
|
|
@ -13,6 +13,7 @@ class Button(TypedDict):
|
|||
url: str
|
||||
|
||||
class Display(TypedDict):
|
||||
hideTotalTime: bool
|
||||
useRemainingTime: bool
|
||||
posters: Posters
|
||||
buttons: list[Button]
|
||||
|
|
|
@ -181,7 +181,7 @@ class PlexAlertListener(threading.Thread):
|
|||
title: str
|
||||
thumb: str
|
||||
if mediaType in ["movie", "episode"]:
|
||||
stateStrings: list[str] = [formatSeconds(item.duration / 1000)]
|
||||
stateStrings: list[str] = [] if config["display"]["hideTotalTime"] else [formatSeconds(item.duration / 1000)]
|
||||
if mediaType == "movie":
|
||||
title = f"{item.title} ({item.year})"
|
||||
genres: list[Genre] = item.genres[:3]
|
||||
|
|
|
@ -12,6 +12,7 @@ config: models.config.Config = {
|
|||
"writeToFile": False,
|
||||
},
|
||||
"display": {
|
||||
"hideTotalTime": False,
|
||||
"useRemainingTime": False,
|
||||
"posters": {
|
||||
"enabled": False,
|
||||
|
|
|
@ -2,7 +2,7 @@ import os
|
|||
import sys
|
||||
|
||||
name = "Discord Rich Presence for Plex"
|
||||
version = "2.3.0"
|
||||
version = "2.3.1"
|
||||
|
||||
plexClientID = "discord-rich-presence-plex"
|
||||
discordClientID = "413407336082833418"
|
||||
|
|
Loading…
Reference in a new issue