aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Server.Implementations
diff options
context:
space:
mode:
authorLuke Pulverenti <luke.pulverenti@gmail.com>2015-03-24 23:54:32 -0400
committerLuke Pulverenti <luke.pulverenti@gmail.com>2015-03-24 23:54:32 -0400
commitbbaf88ae1f088584f9130852cd99ad372adce136 (patch)
treed3f1f19c44527f96d603b09a6c960f33b3efd2c7 /MediaBrowser.Server.Implementations
parente62270df353aa8e2ae0a20aeff7d5aa6f9b62630 (diff)
update tv db cleanup
Diffstat (limited to 'MediaBrowser.Server.Implementations')
-rw-r--r--MediaBrowser.Server.Implementations/HttpServer/Security/SessionContext.cs16
-rw-r--r--MediaBrowser.Server.Implementations/LiveTv/LiveTvManager.cs2
-rw-r--r--MediaBrowser.Server.Implementations/Persistence/SqliteItemRepository.cs6
-rw-r--r--MediaBrowser.Server.Implementations/Photos/BaseDynamicImageProvider.cs2
-rw-r--r--MediaBrowser.Server.Implementations/Session/WebSocketController.cs10
5 files changed, 22 insertions, 14 deletions
diff --git a/MediaBrowser.Server.Implementations/HttpServer/Security/SessionContext.cs b/MediaBrowser.Server.Implementations/HttpServer/Security/SessionContext.cs
index c8278dc54..f40d117c4 100644
--- a/MediaBrowser.Server.Implementations/HttpServer/Security/SessionContext.cs
+++ b/MediaBrowser.Server.Implementations/HttpServer/Security/SessionContext.cs
@@ -25,14 +25,14 @@ namespace MediaBrowser.Server.Implementations.HttpServer.Security
{
var authorization = _authContext.GetAuthorizationInfo(requestContext);
- if (!string.IsNullOrWhiteSpace(authorization.Token))
- {
- var auth = GetTokenInfo(requestContext);
- if (auth != null)
- {
- return _sessionManager.GetSessionByAuthenticationToken(auth, authorization.DeviceId, requestContext.RemoteIp, authorization.Version);
- }
- }
+ //if (!string.IsNullOrWhiteSpace(authorization.Token))
+ //{
+ // var auth = GetTokenInfo(requestContext);
+ // if (auth != null)
+ // {
+ // return _sessionManager.GetSessionByAuthenticationToken(auth, authorization.DeviceId, requestContext.RemoteIp, authorization.Version);
+ // }
+ //}
var session = _sessionManager.GetSession(authorization.DeviceId, authorization.Client, authorization.Version);
return Task.FromResult(session);
diff --git a/MediaBrowser.Server.Implementations/LiveTv/LiveTvManager.cs b/MediaBrowser.Server.Implementations/LiveTv/LiveTvManager.cs
index ffa774300..2bc6cbadf 100644
--- a/MediaBrowser.Server.Implementations/LiveTv/LiveTvManager.cs
+++ b/MediaBrowser.Server.Implementations/LiveTv/LiveTvManager.cs
@@ -1115,7 +1115,7 @@ namespace MediaBrowser.Server.Implementations.LiveTv
{
cancellationToken.ThrowIfCancellationRequested();
- if (!currentIdList.Contains(new Guid(programId)))
+ if (!currentIdList.Contains(programId))
{
var program = _libraryManager.GetItemById(programId);
diff --git a/MediaBrowser.Server.Implementations/Persistence/SqliteItemRepository.cs b/MediaBrowser.Server.Implementations/Persistence/SqliteItemRepository.cs
index 4c45d5b83..12ce60d45 100644
--- a/MediaBrowser.Server.Implementations/Persistence/SqliteItemRepository.cs
+++ b/MediaBrowser.Server.Implementations/Persistence/SqliteItemRepository.cs
@@ -521,8 +521,8 @@ namespace MediaBrowser.Server.Implementations.Persistence
}
}
}
-
- public IEnumerable<string> GetItemsOfType(Type type)
+
+ public IEnumerable<Guid> GetItemsOfType(Type type)
{
if (type == null)
{
@@ -541,7 +541,7 @@ namespace MediaBrowser.Server.Implementations.Persistence
{
while (reader.Read())
{
- yield return reader.GetString(0);
+ yield return reader.GetGuid(0);
}
}
}
diff --git a/MediaBrowser.Server.Implementations/Photos/BaseDynamicImageProvider.cs b/MediaBrowser.Server.Implementations/Photos/BaseDynamicImageProvider.cs
index 2cfc873de..6fb02358e 100644
--- a/MediaBrowser.Server.Implementations/Photos/BaseDynamicImageProvider.cs
+++ b/MediaBrowser.Server.Implementations/Photos/BaseDynamicImageProvider.cs
@@ -125,7 +125,7 @@ namespace MediaBrowser.Server.Implementations.Photos
protected abstract Task<List<BaseItem>> GetItemsWithImages(IHasImages item);
- private const string Version = "3";
+ private const string Version = "4";
protected string GetConfigurationCacheKey(List<BaseItem> items, string itemName)
{
var parts = Version + "_" + (itemName ?? string.Empty) + "_" +
diff --git a/MediaBrowser.Server.Implementations/Session/WebSocketController.cs b/MediaBrowser.Server.Implementations/Session/WebSocketController.cs
index 1e1949533..765664299 100644
--- a/MediaBrowser.Server.Implementations/Session/WebSocketController.cs
+++ b/MediaBrowser.Server.Implementations/Session/WebSocketController.cs
@@ -41,17 +41,25 @@ namespace MediaBrowser.Server.Implementations.Session
}
private bool _isActive;
+ private DateTime _lastActivityDate;
public bool IsSessionActive
{
get
{
- return HasOpenSockets;
+ if (HasOpenSockets)
+ {
+ return true;
+ }
+
+ //return false;
+ return _isActive && (DateTime.UtcNow - _lastActivityDate).TotalMinutes <= 10;
}
}
public void OnActivity()
{
_isActive = true;
+ _lastActivityDate = DateTime.UtcNow;
}
private IEnumerable<IWebSocketConnection> GetActiveSockets()