consolidate slideout panels

This commit is contained in:
Luke Pulverenti
2015-05-29 19:51:33 -04:00
parent 81a90a49b3
commit 4e04d31c7d
34 changed files with 171 additions and 135 deletions

View File

@@ -1,5 +1,4 @@
using System.Collections.Generic;
using MediaBrowser.Common.Events;
using MediaBrowser.Common.Events;
using MediaBrowser.Controller.Configuration;
using MediaBrowser.Controller.Entities;
using MediaBrowser.Controller.Entities.Audio;
@@ -10,6 +9,7 @@ using MediaBrowser.Model.Entities;
using MediaBrowser.Model.Logging;
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;
@@ -262,5 +262,9 @@ namespace MediaBrowser.Server.Implementations.Library
return playedToCompletion;
}
public UserItemData GetUserData(string userId, string key)
{
return GetUserData(new Guid(userId), key);
}
}
}

View File

@@ -723,7 +723,7 @@
"MessageInvitationSentToNewUser": "An email has been sent to {0} inviting them to sign up with Emby.",
"HeaderConnectionFailure": "Connection Failure",
"MessageUnableToConnectToServer": "We're unable to connect to the selected server right now. Please ensure it is running and try again.",
"ButtonSelectServer": "Select server",
"ButtonSelectServer": "Select Server",
"MessagePluginConfigurationRequiresLocalAccess": "To configure this plugin please sign in to your local server directly.",
"MessageLoggedOutParentalControl": "Access is currently restricted. Please try again later.",
"DefaultErrorMessage": "There was an error processing the request. Please try again later.",
@@ -787,5 +787,8 @@
"MessagePleaseSignInLocalNetwork": "Before proceeding, please ensure that you're connected to your local network using a Wifi or LAN connection.",
"ButtonUnlockWithPurchase": "Unlock with Purchase",
"MessageLiveTvGuideRequiresUnlock": "The Live TV Guide is currently limited to {0} channels. Click the unlock button to learn how to enjoy the full experience.",
"OptionEnableFullscreen": "Enable Fullscreen"
"OptionEnableFullscreen": "Enable Fullscreen",
"ButtonServer": "Server",
"HeaderAdmin": "Admin",
"HeaderLibrary": "Library"
}

View File

@@ -309,5 +309,15 @@ namespace MediaBrowser.Server.Implementations.Persistence
_connection = null;
}
}
public Task SaveDisplayPreferences(DisplayPreferences displayPreferences, string userId, string client, CancellationToken cancellationToken)
{
return SaveDisplayPreferences(displayPreferences, new Guid(userId), client, cancellationToken);
}
public DisplayPreferences GetDisplayPreferences(string displayPreferencesId, string userId, string client)
{
return GetDisplayPreferences(displayPreferencesId, new Guid(userId), client);
}
}
}

View File

@@ -1203,22 +1203,22 @@ namespace MediaBrowser.Server.Implementations.Session
/// <param name="userId">The user identifier.</param>
/// <exception cref="System.UnauthorizedAccessException">Cannot modify additional users without authenticating first.</exception>
/// <exception cref="System.ArgumentException">The requested user is already the primary user of the session.</exception>
public void AddAdditionalUser(string sessionId, Guid userId)
public void AddAdditionalUser(string sessionId, string userId)
{
var session = GetSession(sessionId);
if (session.UserId.HasValue && session.UserId.Value == userId)
if (session.UserId.HasValue && session.UserId.Value == new Guid(userId))
{
throw new ArgumentException("The requested user is already the primary user of the session.");
}
if (session.AdditionalUsers.All(i => new Guid(i.UserId) != userId))
if (session.AdditionalUsers.All(i => new Guid(i.UserId) != new Guid(userId)))
{
var user = _userManager.GetUserById(userId);
session.AdditionalUsers.Add(new SessionUserInfo
{
UserId = userId.ToString("N"),
UserId = userId,
UserName = user.Name
});
}
@@ -1231,16 +1231,16 @@ namespace MediaBrowser.Server.Implementations.Session
/// <param name="userId">The user identifier.</param>
/// <exception cref="System.UnauthorizedAccessException">Cannot modify additional users without authenticating first.</exception>
/// <exception cref="System.ArgumentException">The requested user is already the primary user of the session.</exception>
public void RemoveAdditionalUser(string sessionId, Guid userId)
public void RemoveAdditionalUser(string sessionId, string userId)
{
var session = GetSession(sessionId);
if (session.UserId.HasValue && session.UserId.Value == userId)
if (session.UserId.HasValue && session.UserId.Value == new Guid(userId))
{
throw new ArgumentException("The requested user is already the primary user of the session.");
}
var user = session.AdditionalUsers.FirstOrDefault(i => new Guid(i.UserId) == userId);
var user = session.AdditionalUsers.FirstOrDefault(i => new Guid(i.UserId) == new Guid(userId));
if (user != null)
{