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
1 changed files with 3 additions and 1 deletions

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;
}
}
}