From 048cbe9fd1174be3ef1521f1fc0756763b6a81a3 Mon Sep 17 00:00:00 2001 From: Hayden Date: Tue, 13 Jun 2023 21:59:51 -0600 Subject: [PATCH] Fixed: Limit Discord embed title length to 256 characters Co-authored-by: HeyBanditoz <7574664+HeyBanditoz@users.noreply.github.com> (cherry picked from commit a6a61a016be777972f60f76a63d8e828f96a27cd) Closes #3796 --- src/NzbDrone.Core/Notifications/Discord/Discord.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/NzbDrone.Core/Notifications/Discord/Discord.cs b/src/NzbDrone.Core/Notifications/Discord/Discord.cs index 865951f6b..60ff2c430 100644 --- a/src/NzbDrone.Core/Notifications/Discord/Discord.cs +++ b/src/NzbDrone.Core/Notifications/Discord/Discord.cs @@ -485,7 +485,9 @@ namespace NzbDrone.Core.Notifications.Discord { var albumTitles = string.Join(" + ", albums.Select(e => e.Title)); - return $"{artist.Name} - {albumTitles}"; + var title = $"{artist.Name} - {albumTitles}"; + + return title.Length > 256 ? $"{title.AsSpan(0, 253)}..." : title; } } }