Added config option to hide media's total duration

This commit is contained in:
Phin 2022-09-06 01:05:22 +05:30
parent 1792552745
commit b66eae9b6b
5 changed files with 10 additions and 6 deletions

View file

@ -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,

View file

@ -13,6 +13,7 @@ class Button(TypedDict):
url: str
class Display(TypedDict):
hideTotalTime: bool
useRemainingTime: bool
posters: Posters
buttons: list[Button]

View file

@ -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]

View file

@ -12,6 +12,7 @@ config: models.config.Config = {
"writeToFile": False,
},
"display": {
"hideTotalTime": False,
"useRemainingTime": False,
"posters": {
"enabled": False,

View file

@ -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"