Added logic to stop duplicate shows from being announced using redis cache
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user