aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuke Pulverenti <luke.pulverenti@gmail.com>2015-03-28 14:55:00 -0400
committerLuke Pulverenti <luke.pulverenti@gmail.com>2015-03-28 14:55:00 -0400
commit3add1872c860cae14f85b339fef843ff962574aa (patch)
tree3f389d055b55158f345afce3866205ed57ef2b38
parentbda0b2f7c490fbd2f462902aba13ee7db80688c3 (diff)
make sure appVersion is set
-rw-r--r--MediaBrowser.Server.Implementations/Session/SessionManager.cs11
-rw-r--r--SharedVersion.cs4
2 files changed, 11 insertions, 4 deletions
diff --git a/MediaBrowser.Server.Implementations/Session/SessionManager.cs b/MediaBrowser.Server.Implementations/Session/SessionManager.cs
index f88e21aea..201e86fe2 100644
--- a/MediaBrowser.Server.Implementations/Session/SessionManager.cs
+++ b/MediaBrowser.Server.Implementations/Session/SessionManager.cs
@@ -1225,7 +1225,7 @@ namespace MediaBrowser.Server.Implementations.Session
throw new UnauthorizedAccessException("Invalid user or password entered.");
}
- var token = await GetAuthorizationToken(user.Id.ToString("N"), request.DeviceId, request.App, request.DeviceName).ConfigureAwait(false);
+ var token = await GetAuthorizationToken(user.Id.ToString("N"), request.DeviceId, request.App, request.AppVersion, request.DeviceName).ConfigureAwait(false);
EventHelper.FireEventIfNotNull(AuthenticationSucceeded, this, new GenericEventArgs<AuthenticationRequest>(request), _logger);
@@ -1246,7 +1246,7 @@ namespace MediaBrowser.Server.Implementations.Session
};
}
- private async Task<string> GetAuthorizationToken(string userId, string deviceId, string app, string deviceName)
+ private async Task<string> GetAuthorizationToken(string userId, string deviceId, string app, string appVersion, string deviceName)
{
var existing = _authRepo.Get(new AuthenticationInfoQuery
{
@@ -1265,6 +1265,7 @@ namespace MediaBrowser.Server.Implementations.Session
var newToken = new AuthenticationInfo
{
AppName = app,
+ AppVersion = appVersion,
DateCreated = DateTime.UtcNow,
DeviceId = deviceId,
DeviceName = deviceName,
@@ -1690,6 +1691,12 @@ namespace MediaBrowser.Server.Implementations.Session
deviceId = info.DeviceId;
}
+ // Prevent argument exception
+ if (string.IsNullOrWhiteSpace(appVersion))
+ {
+ appVersion = "1";
+ }
+
return LogSessionActivity(appName, appVersion, deviceId, deviceName, remoteEndpoint, user);
}
diff --git a/SharedVersion.cs b/SharedVersion.cs
index 621b97a63..8019ca0e3 100644
--- a/SharedVersion.cs
+++ b/SharedVersion.cs
@@ -1,4 +1,4 @@
using System.Reflection;
-//[assembly: AssemblyVersion("3.0.*")]
-[assembly: AssemblyVersion("3.0.5557.30000")]
+[assembly: AssemblyVersion("3.0.*")]
+//[assembly: AssemblyVersion("3.0.5557.30000")]