diff --git a/AnimeAnnouncer/Program.cs b/AnimeAnnouncer/Program.cs index 4c03939..92e373b 100644 --- a/AnimeAnnouncer/Program.cs +++ b/AnimeAnnouncer/Program.cs @@ -257,16 +257,21 @@ namespace AnimeAnnouncer //Prepare Status String statusText = $"{cachedShow.Title} ({cachedShow.VoteAverage}/10) DUBBED has finished airing season {cachedShow.LatestSeasonNumber}! Episode {cachedShow.LastEpisodeNumber} is now available for download. {Environment.NewLine + Environment.NewLine}"; String overview = !String.IsNullOrWhiteSpace(cachedShow.LatestSeasonOverview) ? cachedShow.LatestSeasonOverview : cachedShow.Overview ?? String.Empty; - if(!String.IsNullOrWhiteSpace(overview)) + if (!String.IsNullOrWhiteSpace(overview)) { - statusText += $"Overview: {overview}"; + statusText += $"{overview}"; } - if(statusText.Length >= 500) + String anidbLink = $"{Environment.NewLine}https://anilist.co/search/anime?search={cachedShow.Title.Replace(" ", "%20")}"; + int linkLength = anidbLink.Length; + + if (statusText.Length + linkLength + 3 >= 500) { - statusText = statusText[..497] + ".."; + statusText = statusText[..(500 - (linkLength + 3))]; } - _ = mastodonClient.PublishStatus(statusText, - Visibility.Public, mediaIds: attachment != null ? new String[] {attachment.Id} : null); + statusText += $"..{anidbLink}"; + + _ = mastodonClient.PublishStatus(statusText, + Visibility.Public, mediaIds: attachment != null ? new String[] { attachment.Id } : null); } }