Added logic to stop duplicate shows from being announced using redis cache

This commit is contained in:
2024-09-25 17:06:22 -04:00
parent 687076abeb
commit 35af1eb29b
2 changed files with 23 additions and 2 deletions

View File

@@ -1,4 +1,5 @@
using System.ComponentModel;
using System.Security.Cryptography;
using AnimeAnnouncer.Cache;
using AnimeAnnouncer.RSS;
using Mastonet;
@@ -166,7 +167,16 @@ namespace AnimeAnnouncer
return;
}
// Announce
// Announce if unique
if(await tmdbCache.KeyExists($"ShowAnnounced-{supposedShowId}"))
{
Console.WriteLine($"{title} has been previously announced, so avoiding announcing it again.");
return;
}
else
{
_ = tmdbCache.SetPair($"ShowAnnounced-{supposedShowId}", "1");
}
if(mastodonClient != null)
{
try