Added anidb search link for the mastodon post
This commit is contained in:
@@ -259,12 +259,17 @@ namespace AnimeAnnouncer
|
||||
String overview = !String.IsNullOrWhiteSpace(cachedShow.LatestSeasonOverview) ? cachedShow.LatestSeasonOverview : cachedShow.Overview ?? String.Empty;
|
||||
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))];
|
||||
}
|
||||
statusText += $"..{anidbLink}";
|
||||
|
||||
_ = mastodonClient.PublishStatus(statusText,
|
||||
Visibility.Public, mediaIds: attachment != null ? new String[] { attachment.Id } : null);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user