aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Model
diff options
context:
space:
mode:
Diffstat (limited to 'MediaBrowser.Model')
-rw-r--r--MediaBrowser.Model/Dlna/EventSubscription.cs34
-rw-r--r--MediaBrowser.Model/MediaBrowser.Model.csproj1
2 files changed, 35 insertions, 0 deletions
diff --git a/MediaBrowser.Model/Dlna/EventSubscription.cs b/MediaBrowser.Model/Dlna/EventSubscription.cs
new file mode 100644
index 000000000..863ea508a
--- /dev/null
+++ b/MediaBrowser.Model/Dlna/EventSubscription.cs
@@ -0,0 +1,34 @@
+using System;
+
+namespace MediaBrowser.Model.Dlna
+{
+ 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;
+ }
+ }
+ }
+}
diff --git a/MediaBrowser.Model/MediaBrowser.Model.csproj b/MediaBrowser.Model/MediaBrowser.Model.csproj
index a4f0a609f..c18d7e8dc 100644
--- a/MediaBrowser.Model/MediaBrowser.Model.csproj
+++ b/MediaBrowser.Model/MediaBrowser.Model.csproj
@@ -73,6 +73,7 @@
<Compile Include="Dlna\DeviceProfileInfo.cs" />
<Compile Include="Dlna\DirectPlayProfile.cs" />
<Compile Include="Dlna\DlnaMaps.cs" />
+ <Compile Include="Dlna\EventSubscription.cs" />
<Compile Include="Dlna\Filter.cs" />
<Compile Include="Dlna\MediaFormatProfile.cs" />
<Compile Include="Dlna\MediaFormatProfileResolver.cs" />