1
0
Fork 0
mirror of https://github.com/lidarr/Lidarr synced 2025-02-25 15:22:42 +00:00

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
This commit is contained in:
Hayden 2023-06-13 21:59:51 -06:00 committed by Bogdan
parent 9bc318e6b0
commit 048cbe9fd1

View file

@ -485,7 +485,9 @@ private string GetTitle(Artist artist, List<Album> albums)
{ {
var albumTitles = string.Join(" + ", albums.Select(e => e.Title)); 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;
} }
} }
} }