update service text in wizard

pull/702/head
Luke Pulverenti 11 years ago
parent a0df73b21d
commit a90908f0f7

@ -168,7 +168,7 @@ namespace MediaBrowser.Common.Implementations.Updates
{ {
// Let dev users get results more often for testing purposes // Let dev users get results more often for testing purposes
var cacheLength = _config.CommonConfiguration.SystemUpdateLevel == PackageVersionClass.Dev var cacheLength = _config.CommonConfiguration.SystemUpdateLevel == PackageVersionClass.Dev
? TimeSpan.FromHours(1) ? TimeSpan.FromMinutes(15)
: TimeSpan.FromHours(12); : TimeSpan.FromHours(12);
if ((DateTime.UtcNow - _lastPackageListResult.Item2) < cacheLength) if ((DateTime.UtcNow - _lastPackageListResult.Item2) < cacheLength)

@ -44,11 +44,13 @@ namespace MediaBrowser.Server.Implementations.Session
/// <value>The configuration manager.</value> /// <value>The configuration manager.</value>
private readonly IServerConfigurationManager _configurationManager; private readonly IServerConfigurationManager _configurationManager;
private object _sessionLock = new object();
/// <summary> /// <summary>
/// The _active connections /// The _active connections
/// </summary> /// </summary>
private readonly ConcurrentDictionary<string, SessionInfo> _activeConnections = private readonly Dictionary<string, SessionInfo> _activeConnections =
new ConcurrentDictionary<string, SessionInfo>(StringComparer.OrdinalIgnoreCase); new Dictionary<string, SessionInfo>(StringComparer.OrdinalIgnoreCase);
/// <summary> /// <summary>
/// Occurs when [playback start]. /// Occurs when [playback start].
@ -84,7 +86,7 @@ namespace MediaBrowser.Server.Implementations.Session
/// <value>All connections.</value> /// <value>All connections.</value>
public IEnumerable<SessionInfo> Sessions public IEnumerable<SessionInfo> Sessions
{ {
get { return _activeConnections.Values.OrderByDescending(c => c.LastActivityDate).ToList(); } get { return _activeConnections.Values.ToList().OrderByDescending(c => c.LastActivityDate); }
} }
/// <summary> /// <summary>
@ -193,19 +195,29 @@ namespace MediaBrowser.Server.Implementations.Session
{ {
var key = clientType + deviceId + appVersion; var key = clientType + deviceId + appVersion;
var connection = _activeConnections.GetOrAdd(key, keyName => new SessionInfo lock (_sessionLock)
{
SessionInfo connection;
if (!_activeConnections.TryGetValue(key, out connection))
{
connection = new SessionInfo
{ {
Client = clientType, Client = clientType,
DeviceId = deviceId, DeviceId = deviceId,
ApplicationVersion = appVersion, ApplicationVersion = appVersion,
Id = Guid.NewGuid() Id = Guid.NewGuid()
}); };
_activeConnections[key] = connection;
}
connection.DeviceName = deviceName; connection.DeviceName = deviceName;
connection.User = user; connection.User = user;
return connection; return connection;
} }
}
/// <summary> /// <summary>
/// Used to report that playback has started for an item /// Used to report that playback has started for an item

Loading…
Cancel
Save