mirror of
https://github.com/phin05/discord-rich-presence-plex
synced 2024-11-21 17:13:04 +00:00
Limited the length of large_text
and small_text
in Discord Activity object
This commit is contained in:
parent
969a924488
commit
cc03fbbf8b
1 changed files with 3 additions and 3 deletions
|
@ -270,7 +270,7 @@ class PlexAlertListener(threading.Thread):
|
||||||
if config["display"]["year"]:
|
if config["display"]["year"]:
|
||||||
parent = self.server.fetchItem(item.parentRatingKey)
|
parent = self.server.fetchItem(item.parentRatingKey)
|
||||||
if parent.year:
|
if parent.year:
|
||||||
largeText += f" ({parent.year})"
|
largeText = f"{truncate(largeText, 110)} ({parent.year})"
|
||||||
thumb = item.thumb
|
thumb = item.thumb
|
||||||
smallText = item.originalTitle or item.grandparentTitle
|
smallText = item.originalTitle or item.grandparentTitle
|
||||||
stateStrings.append(smallText)
|
stateStrings.append(smallText)
|
||||||
|
@ -298,11 +298,11 @@ class PlexAlertListener(threading.Thread):
|
||||||
if largeText or thumbUrl or smallText or smallThumbUrl:
|
if largeText or thumbUrl or smallText or smallThumbUrl:
|
||||||
activity["assets"] = {}
|
activity["assets"] = {}
|
||||||
if largeText:
|
if largeText:
|
||||||
activity["assets"]["large_text"] = largeText
|
activity["assets"]["large_text"] = truncate(largeText, 120)
|
||||||
if thumbUrl:
|
if thumbUrl:
|
||||||
activity["assets"]["large_image"] = thumbUrl
|
activity["assets"]["large_image"] = thumbUrl
|
||||||
if smallText:
|
if smallText:
|
||||||
activity["assets"]["small_text"] = smallText
|
activity["assets"]["small_text"] = truncate(smallText, 120)
|
||||||
if smallThumbUrl:
|
if smallThumbUrl:
|
||||||
activity["assets"]["small_image"] = smallThumbUrl
|
activity["assets"]["small_image"] = smallThumbUrl
|
||||||
if stateText:
|
if stateText:
|
||||||
|
|
Loading…
Reference in a new issue