Resolved #901 DiscordRPC length issues
This commit is contained in:
parent
8b7b8c3dbf
commit
295da6a757
1 changed files with 12 additions and 2 deletions
|
@ -137,11 +137,21 @@ export default class DiscordRPC {
|
|||
}
|
||||
})
|
||||
|
||||
// Checks if the name is greater than 128 because some songs can be that long
|
||||
if (activity.details && activity.details.length > 128) {
|
||||
// Checks if the details is greater than 128 because some songs can be that long
|
||||
if (activity.details && activity.details.length >= 128) {
|
||||
activity.details = activity.details.substring(0, 125) + '...'
|
||||
}
|
||||
|
||||
// Checks if the state is greater than 128 because some songs can be that long
|
||||
if (activity.state && activity.state.length >= 128) {
|
||||
activity.state = activity.state.substring(0, 125) + '...'
|
||||
}
|
||||
|
||||
// Checks if the state is greater than 128 because some songs can be that long
|
||||
if (activity.largeImageText && activity.largeImageText.length >= 128) {
|
||||
activity.largeImageText = activity.largeImageText.substring(0, 125) + '...'
|
||||
}
|
||||
|
||||
// Check large image
|
||||
if (activity.largeImageKey == null || activity.largeImageKey === "" || activity.largeImageKey.length > 256) {
|
||||
activity.largeImageKey = "cider";
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue