diff options
| author | Luke Pulverenti <luke.pulverenti@gmail.com> | 2016-10-29 18:22:20 -0400 |
|---|---|---|
| committer | Luke Pulverenti <luke.pulverenti@gmail.com> | 2016-10-29 18:22:20 -0400 |
| commit | dca78b13411db96366dddfa0d68bb6d36d28ad14 (patch) | |
| tree | 7d41e670f1cadec0db9e1ed7115e151da891f7ea /Emby.Dlna/Eventing/EventSubscription.cs | |
| parent | 597e27d1c6199a40398abb068282711a9cb9db1b (diff) | |
rework dlna project
Diffstat (limited to 'Emby.Dlna/Eventing/EventSubscription.cs')
| -rw-r--r-- | Emby.Dlna/Eventing/EventSubscription.cs | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/Emby.Dlna/Eventing/EventSubscription.cs b/Emby.Dlna/Eventing/EventSubscription.cs new file mode 100644 index 0000000000..bd4cbdd55d --- /dev/null +++ b/Emby.Dlna/Eventing/EventSubscription.cs @@ -0,0 +1,34 @@ +using System; + +namespace MediaBrowser.Dlna.Eventing +{ + public class EventSubscription + { + public string Id { get; set; } + public string CallbackUrl { get; set; } + public string NotificationType { get; set; } + + public DateTime SubscriptionTime { get; set; } + public int TimeoutSeconds { get; set; } + + public long TriggerCount { get; set; } + + public void IncrementTriggerCount() + { + if (TriggerCount == long.MaxValue) + { + TriggerCount = 0; + } + + TriggerCount++; + } + + public bool IsExpired + { + get + { + return SubscriptionTime.AddSeconds(TimeoutSeconds) >= DateTime.UtcNow; + } + } + } +} |
