From 0c9bd7122d32b4e214a287892ccd658b98b42a6d Mon Sep 17 00:00:00 2001 From: Phin <59180111+phin05@users.noreply.github.com> Date: Tue, 6 Sep 2022 01:22:18 +0530 Subject: [PATCH] Tweaks --- .github/CONTRIBUTING.md => CONTRIBUTING.md | 0 README.md | 6 +++--- services/PlexAlertListener.py | 5 ++++- store/constants.py | 2 +- 4 files changed, 8 insertions(+), 5 deletions(-) rename .github/CONTRIBUTING.md => CONTRIBUTING.md (100%) diff --git a/.github/CONTRIBUTING.md b/CONTRIBUTING.md similarity index 100% rename from .github/CONTRIBUTING.md rename to CONTRIBUTING.md diff --git a/README.md b/README.md index 05ebc06..de72392 100644 --- a/README.md +++ b/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.1 +Current Version: 2.3.2 ## Getting Started @@ -51,9 +51,9 @@ The script must be running on the same machine as your Discord client. ### Buttons -A maximum of 2 buttons can be displayed in your Rich Presence. +Discord can display up to 2 buttons in your Rich Presence. -Due to a strange Discord bug, buttons displayed in your Rich Presence are unresponsive to your own clicks, but other users are able to click on them to open their corresponding URLs. +Due to a strange Discord bug, these buttons are unresponsive or exhibit strange behaviour towards your own clicks, but other users are able to click on them to open their corresponding URLs. #### Dynamic Button URLs diff --git a/services/PlexAlertListener.py b/services/PlexAlertListener.py index ddd7fff..645c3c1 100644 --- a/services/PlexAlertListener.py +++ b/services/PlexAlertListener.py @@ -195,7 +195,10 @@ class PlexAlertListener(threading.Thread): largeText = "Watching a TV show" thumb = item.grandparentThumb if state != "playing": - stateStrings.append(f"{formatSeconds(viewOffset / 1000, ':')} elapsed") + if config["display"]["useRemainingTime"]: + stateStrings.append(f"{formatSeconds((item.duration - viewOffset) / 1000, ':')} left") + else: + stateStrings.append(f"{formatSeconds(viewOffset / 1000, ':')} elapsed") stateText = " ยท ".join(stateString for stateString in stateStrings if stateString) elif mediaType == "track": title = item.title diff --git a/store/constants.py b/store/constants.py index 0643e91..c23ca35 100644 --- a/store/constants.py +++ b/store/constants.py @@ -2,7 +2,7 @@ import os import sys name = "Discord Rich Presence for Plex" -version = "2.3.1" +version = "2.3.2" plexClientID = "discord-rich-presence-plex" discordClientID = "413407336082833418"