1
0
Fork 0
mirror of https://github.com/Sonarr/Sonarr synced 2025-01-03 13:45:02 +00:00

Fixed: Limit Discord embed title length to 256 characters

Co-authored-by: HeyBanditoz <7574664+HeyBanditoz@users.noreply.github.com>
This commit is contained in:
Hayden 2023-06-13 21:59:51 -06:00 committed by GitHub
parent 11bd764a75
commit a6a61a016b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -558,7 +558,9 @@ namespace NzbDrone.Core.Notifications.Discord
var episodeTitles = string.Join(" + ", episodes.Select(e => e.Title));
return $"{series.Title} - {episodes.First().SeasonNumber}{episodeNumbers} - {episodeTitles}";
var title = $"{series.Title} - {episodes.First().SeasonNumber}{episodeNumbers} - {episodeTitles}";
return title.Length > 256 ? $"{title.AsSpan(0, 253)}..." : title;
}
}
}