1
0
mirror of https://github.com/Sonarr/Sonarr.git synced 2024-12-12 11:15:43 +02:00
Sonarr/NzbDrone.Core/Providers/NotificationProvider.cs

27 lines
697 B
C#
Raw Normal View History

using System;
using System.Collections.Generic;
2011-04-10 05:44:01 +03:00
using System.Linq;
using NzbDrone.Core.Model.Notification;
namespace NzbDrone.Core.Providers
{
2011-04-09 02:48:47 +03:00
public class NotificationProvider
{
2011-11-21 07:43:16 +03:00
private static ProgressNotification _currentNotification;
2011-11-21 07:43:16 +03:00
public virtual ProgressNotification GetCurrent()
{
2011-11-21 07:43:16 +03:00
if (_currentNotification == null || _currentNotification.CompletedTime < DateTime.Now.AddSeconds(-3))
2010-11-06 02:43:13 +02:00
{
2011-11-21 07:43:16 +03:00
return null;
2010-11-06 02:43:13 +02:00
}
2011-11-21 07:43:16 +03:00
return _currentNotification;
}
2011-04-10 05:44:01 +03:00
public virtual void Register(ProgressNotification notification)
{
2011-11-21 07:43:16 +03:00
_currentNotification = notification;
2011-04-10 05:44:01 +03:00
}
}
}