beta fixes

This commit is contained in:
Luke Pulverenti
2015-03-21 12:10:02 -04:00
parent e068e84ab6
commit c0aec48a31
23 changed files with 137 additions and 101 deletions

View File

@@ -150,7 +150,7 @@ namespace MediaBrowser.Server.Implementations.Connect
if (string.IsNullOrWhiteSpace(wanApiAddress))
{
_logger.Warn("Cannot update Media Browser Connect information without a WanApiAddress");
_logger.Warn("Cannot update Emby Connect information without a WanApiAddress");
return;
}
@@ -411,7 +411,7 @@ namespace MediaBrowser.Server.Implementations.Connect
if (!connectUser.IsActive)
{
throw new ArgumentException("The Media Browser account has been disabled.");
throw new ArgumentException("The Emby account has been disabled.");
}
var user = GetUser(userId);
@@ -517,7 +517,7 @@ namespace MediaBrowser.Server.Implementations.Connect
if (!connectUser.IsActive)
{
throw new ArgumentException("The Media Browser account has been disabled.");
throw new ArgumentException("The Emby account has been disabled.");
}
connectUserId = connectUser.Id;

View File

@@ -389,7 +389,7 @@ namespace MediaBrowser.Server.Implementations.EntryPoints.Notifications
var notification = new NotificationRequest
{
UserIds = new List<string> { e.Argument.Id.ToString("N") },
Name = "Welcome to Media Browser!",
Name = "Welcome to Emby!",
Description = "Check back here for more notifications."
};

View File

@@ -28,7 +28,10 @@ namespace MediaBrowser.Server.Implementations.HttpServer.Security
if (!string.IsNullOrWhiteSpace(authorization.Token))
{
var auth = GetTokenInfo(requestContext);
return _sessionManager.GetSessionByAuthenticationToken(auth, authorization.DeviceId, requestContext.RemoteIp, authorization.Version);
if (auth != null)
{
return _sessionManager.GetSessionByAuthenticationToken(auth, authorization.DeviceId, requestContext.RemoteIp, authorization.Version);
}
}
var session = _sessionManager.GetSession(authorization.DeviceId, authorization.Client, authorization.Version);

View File

@@ -1111,13 +1111,18 @@ namespace MediaBrowser.Server.Implementations.LiveTv
var numComplete = 0;
foreach (var program in list)
foreach (var programId in list)
{
cancellationToken.ThrowIfCancellationRequested();
if (!currentIdList.Contains(program.Id))
if (!currentIdList.Contains(new Guid(programId)))
{
await _libraryManager.DeleteItem(program).ConfigureAwait(false);
var program = _libraryManager.GetItemById(programId);
if (program != null)
{
await _libraryManager.DeleteItem(program).ConfigureAwait(false);
}
}
numComplete++;

View File

@@ -16,7 +16,7 @@
"LabelNext": "Next",
"LabelYoureDone": "You're Done!",
"WelcomeToMediaBrowser": "Welcome to Media Browser!",
"TitleMediaBrowser": "Media Browser",
"TitleMediaBrowser": "Emby",
"ThisWizardWillGuideYou": "This wizard will help guide you through the setup process. To begin, please select your preferred language.",
"TellUsAboutYourself": "Tell us about yourself",
"ButtonQuickStartGuide": "Quick start guide",

View File

@@ -27,7 +27,7 @@ namespace MediaBrowser.Server.Implementations.Notifications
{
Type = NotificationType.ApplicationUpdateInstalled.ToString(),
DefaultDescription = "{ReleaseNotes}",
DefaultTitle = "A new version of Media Browser Server has been installed.",
DefaultTitle = "A new version of Emby Server has been installed.",
Variables = new List<string>{"Version"}
},
@@ -71,7 +71,7 @@ namespace MediaBrowser.Server.Implementations.Notifications
new NotificationTypeInfo
{
Type = NotificationType.ServerRestartRequired.ToString(),
DefaultTitle = "Please restart Media Browser Server to finish updating."
DefaultTitle = "Please restart Emby Server to finish updating."
},
new NotificationTypeInfo
@@ -158,7 +158,7 @@ namespace MediaBrowser.Server.Implementations.Notifications
knownTypes.Add(new NotificationTypeInfo
{
Type = NotificationType.ApplicationUpdateAvailable.ToString(),
DefaultTitle = "A new version of Media Browser Server is available for download."
DefaultTitle = "A new version of Emby Server is available for download."
});
}

View File

@@ -522,7 +522,7 @@ namespace MediaBrowser.Server.Implementations.Persistence
}
}
public IEnumerable<BaseItem> GetItemsOfType(Type type)
public IEnumerable<string> GetItemsOfType(Type type)
{
if (type == null)
{
@@ -533,7 +533,7 @@ namespace MediaBrowser.Server.Implementations.Persistence
using (var cmd = _connection.CreateCommand())
{
cmd.CommandText = "select type,data from TypedBaseItems where type = @type";
cmd.CommandText = "select guid from TypedBaseItems where type = @type";
cmd.Parameters.Add(cmd, "@type", DbType.String).Value = type.FullName;
@@ -541,12 +541,7 @@ namespace MediaBrowser.Server.Implementations.Persistence
{
while (reader.Read())
{
var item = GetItem(reader);
if (item != null)
{
yield return item;
}
yield return reader.GetString(0);
}
}
}

View File

@@ -108,7 +108,7 @@ namespace MediaBrowser.Server.Implementations.ScheduledTasks
}
else
{
Logger.Info("A new version of Media Browser is available.");
Logger.Info("A new version of " + _appHost.Name + " is available.");
}
progress.Report(100);

View File

@@ -43,6 +43,10 @@ namespace MediaBrowser.Server.Implementations.Session
ResetPingTimer();
}
public void OnActivity()
{
}
private string PostUrl
{
get

View File

@@ -236,34 +236,44 @@ namespace MediaBrowser.Server.Implementations.Session
}
var activityDate = DateTime.UtcNow;
var session = await GetSessionInfo(appName, appVersion, deviceId, deviceName, remoteEndPoint, user).ConfigureAwait(false);
var lastActivityDate = session.LastActivityDate;
session.LastActivityDate = activityDate;
if (user == null)
if (user != null)
{
return session;
var userLastActivityDate = user.LastActivityDate ?? DateTime.MinValue;
user.LastActivityDate = activityDate;
// Don't log in the db anymore frequently than 10 seconds
if ((activityDate - userLastActivityDate).TotalSeconds > 10)
{
try
{
// Save this directly. No need to fire off all the events for this.
await _userRepository.SaveUser(user, CancellationToken.None).ConfigureAwait(false);
}
catch (Exception ex)
{
_logger.ErrorException("Error updating user", ex);
}
}
}
var lastActivityDate = user.LastActivityDate;
user.LastActivityDate = activityDate;
// Don't log in the db anymore frequently than 10 seconds
if (lastActivityDate.HasValue && (activityDate - lastActivityDate.Value).TotalSeconds < 10)
if ((activityDate - lastActivityDate).TotalSeconds > 10)
{
return session;
EventHelper.FireEventIfNotNull(SessionActivity, this, new SessionEventArgs
{
SessionInfo = session
}, _logger);
}
// Save this directly. No need to fire off all the events for this.
await _userRepository.SaveUser(user, CancellationToken.None).ConfigureAwait(false);
EventHelper.FireEventIfNotNull(SessionActivity, this, new SessionEventArgs
var controller = session.SessionController;
if (controller != null)
{
SessionInfo = session
}, _logger);
controller.OnActivity();
}
return session;
}
@@ -1680,7 +1690,7 @@ namespace MediaBrowser.Server.Implementations.Session
deviceId = info.DeviceId;
}
return GetSessionInfo(appName, appVersion, deviceId, deviceName, remoteEndpoint, user);
return LogSessionActivity(appName, appVersion, deviceId, deviceName, remoteEndpoint, user);
}
public Task<SessionInfo> GetSessionByAuthenticationToken(string token, string deviceId, string remoteEndpoint)

View File

@@ -30,17 +30,28 @@ namespace MediaBrowser.Server.Implementations.Session
Sockets = new List<IWebSocketConnection>();
}
public bool IsSessionActive
private bool HasOpenSockets
{
get
{
return Sockets.Any(i => i.State == WebSocketState.Open);
}
get { return GetActiveSockets().Any(); }
}
public bool SupportsMediaControl
{
get { return GetActiveSockets().Any(); }
get { return HasOpenSockets; }
}
private bool _isActive;
public bool IsSessionActive
{
get
{
return _isActive;
}
}
public void OnActivity()
{
_isActive = true;
}
private IEnumerable<IWebSocketConnection> GetActiveSockets()
@@ -64,6 +75,8 @@ namespace MediaBrowser.Server.Implementations.Session
{
if (!GetActiveSockets().Any())
{
_isActive = false;
try
{
_sessionManager.ReportSessionEnded(Session.Id);