From cc03fbbf8b052f646ff9d9e895753591b45eba90 Mon Sep 17 00:00:00 2001 From: Phin <59180111+phin05@users.noreply.github.com> Date: Mon, 23 Sep 2024 17:49:24 +0530 Subject: [PATCH] Limited the length of `large_text` and `small_text` in Discord Activity object --- core/plex.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/core/plex.py b/core/plex.py index 9836859..e944bf2 100644 --- a/core/plex.py +++ b/core/plex.py @@ -270,7 +270,7 @@ class PlexAlertListener(threading.Thread): if config["display"]["year"]: parent = self.server.fetchItem(item.parentRatingKey) if parent.year: - largeText += f" ({parent.year})" + largeText = f"{truncate(largeText, 110)} ({parent.year})" thumb = item.thumb smallText = item.originalTitle or item.grandparentTitle stateStrings.append(smallText) @@ -298,11 +298,11 @@ class PlexAlertListener(threading.Thread): if largeText or thumbUrl or smallText or smallThumbUrl: activity["assets"] = {} if largeText: - activity["assets"]["large_text"] = largeText + activity["assets"]["large_text"] = truncate(largeText, 120) if thumbUrl: activity["assets"]["large_image"] = thumbUrl if smallText: - activity["assets"]["small_text"] = smallText + activity["assets"]["small_text"] = truncate(smallText, 120) if smallThumbUrl: activity["assets"]["small_image"] = smallThumbUrl if stateText: