feat(youtube): multiple stream notifications

Refactors the notification storage to support multiple stream IDs
using a ConcurrentDictionary. This ensures that the bot can track and
ignore duplicate notifications for multiple streams within a
rolling 24-hour window, rather than only tracking the single most
recent stream.

- Updated ILastPostedStreamStore to include RemoveValuesOlderThan24Hours.
- Switched LastPostedStreamStore to use ConcurrentDictionary with UTC timestamps.
- Injected TimeProvider to enable deterministic testing of time-based expiration.
- Added automatic cache pruning in NotificationHandler on every request.
- Renamed Unit/LastPostedStreamStore.cs to Unit/LastPostedStreamStoreTests.cs and expanded test coverage.
This commit is contained in:
Stevan Freeborn
2026-01-11 10:32:57 -06:00
parent 07660a0440
commit 7826e835ef
5 changed files with 97 additions and 40 deletions
@@ -4,4 +4,5 @@ internal interface ILastPostedStreamStore
{
void SetValue(string value);
bool HasValue(string value);
void RemoveValuesOlderThan24Hours();
}