mirror of
https://github.com/Ombi-app/Ombi.git
synced 2025-07-08 14:10:50 -07:00
#122 store utc time in the databse + obtain timezone offset of the client upon login + offset times returned to client based on session offset
This commit is contained in:
parent
ec99dafa29
commit
3dbef199aa
11 changed files with 61 additions and 11 deletions
|
@ -28,12 +28,14 @@
|
|||
using Nancy;
|
||||
using Nancy.Extensions;
|
||||
using PlexRequests.UI.Models;
|
||||
using System;
|
||||
|
||||
namespace PlexRequests.UI.Modules
|
||||
{
|
||||
public class BaseModule : NancyModule
|
||||
{
|
||||
private string _username;
|
||||
private int _dateTimeOffset = -1;
|
||||
|
||||
protected string Username
|
||||
{
|
||||
|
@ -47,6 +49,19 @@ namespace PlexRequests.UI.Modules
|
|||
}
|
||||
}
|
||||
|
||||
protected int DateTimeOffset
|
||||
{
|
||||
get
|
||||
{
|
||||
if (_dateTimeOffset == -1)
|
||||
{
|
||||
_dateTimeOffset = Session[SessionKeys.ClientDateTimeOffsetKey] != null ?
|
||||
(int)Session[SessionKeys.ClientDateTimeOffsetKey] : (new DateTimeOffset().Offset).Minutes;
|
||||
}
|
||||
return _dateTimeOffset;
|
||||
}
|
||||
}
|
||||
|
||||
public BaseModule()
|
||||
{
|
||||
Before += (ctx) => CheckAuth();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue