aboutsummaryrefslogtreecommitdiff
path: root/Jellyfin.Api/Helpers/RequestHelpers.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Jellyfin.Api/Helpers/RequestHelpers.cs')
-rw-r--r--Jellyfin.Api/Helpers/RequestHelpers.cs15
1 files changed, 15 insertions, 0 deletions
diff --git a/Jellyfin.Api/Helpers/RequestHelpers.cs b/Jellyfin.Api/Helpers/RequestHelpers.cs
index 9f4d34f9c..ae8ab37e8 100644
--- a/Jellyfin.Api/Helpers/RequestHelpers.cs
+++ b/Jellyfin.Api/Helpers/RequestHelpers.cs
@@ -1,4 +1,6 @@
using System;
+using MediaBrowser.Controller.Net;
+using MediaBrowser.Controller.Session;
namespace Jellyfin.Api.Helpers
{
@@ -25,5 +27,18 @@ namespace Jellyfin.Api.Helpers
? value.Split(new[] { separator }, StringSplitOptions.RemoveEmptyEntries)
: value.Split(separator);
}
+
+ internal static SessionInfo GetSession(ISessionContext sessionContext)
+ {
+ // TODO: how do we get a SessionInfo without IRequest?
+ SessionInfo session = sessionContext.GetSession("Request");
+
+ if (session == null)
+ {
+ throw new ArgumentException("Session not found.");
+ }
+
+ return session;
+ }
}
}