mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-03-11 12:46:20 +00:00
add connect linking
This commit is contained in:
@@ -110,7 +110,7 @@ namespace MediaBrowser.Server.Implementations.Channels
|
||||
{
|
||||
var user = string.IsNullOrWhiteSpace(query.UserId)
|
||||
? null
|
||||
: _userManager.GetUserById(new Guid(query.UserId));
|
||||
: _userManager.GetUserById(query.UserId);
|
||||
|
||||
var channels = GetAllChannels()
|
||||
.Select(GetChannelEntity)
|
||||
@@ -163,7 +163,7 @@ namespace MediaBrowser.Server.Implementations.Channels
|
||||
{
|
||||
var user = string.IsNullOrWhiteSpace(query.UserId)
|
||||
? null
|
||||
: _userManager.GetUserById(new Guid(query.UserId));
|
||||
: _userManager.GetUserById(query.UserId);
|
||||
|
||||
var internalResult = await GetChannelsInternal(query, cancellationToken).ConfigureAwait(false);
|
||||
|
||||
@@ -565,7 +565,7 @@ namespace MediaBrowser.Server.Implementations.Channels
|
||||
{
|
||||
var user = string.IsNullOrWhiteSpace(query.UserId)
|
||||
? null
|
||||
: _userManager.GetUserById(new Guid(query.UserId));
|
||||
: _userManager.GetUserById(query.UserId);
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(query.UserId) && user == null)
|
||||
{
|
||||
@@ -724,7 +724,7 @@ namespace MediaBrowser.Server.Implementations.Channels
|
||||
{
|
||||
var user = string.IsNullOrWhiteSpace(query.UserId)
|
||||
? null
|
||||
: _userManager.GetUserById(new Guid(query.UserId));
|
||||
: _userManager.GetUserById(query.UserId);
|
||||
|
||||
var channels = GetAllChannels();
|
||||
|
||||
@@ -897,7 +897,7 @@ namespace MediaBrowser.Server.Implementations.Channels
|
||||
|
||||
var user = string.IsNullOrWhiteSpace(query.UserId)
|
||||
? null
|
||||
: _userManager.GetUserById(new Guid(query.UserId));
|
||||
: _userManager.GetUserById(query.UserId);
|
||||
|
||||
ChannelItemSortField? sortField = null;
|
||||
ChannelItemSortField parsedField;
|
||||
@@ -942,7 +942,7 @@ namespace MediaBrowser.Server.Implementations.Channels
|
||||
{
|
||||
var user = string.IsNullOrWhiteSpace(query.UserId)
|
||||
? null
|
||||
: _userManager.GetUserById(new Guid(query.UserId));
|
||||
: _userManager.GetUserById(query.UserId);
|
||||
|
||||
var internalResult = await GetChannelItemsInternal(query, cancellationToken).ConfigureAwait(false);
|
||||
|
||||
@@ -1356,7 +1356,7 @@ namespace MediaBrowser.Server.Implementations.Channels
|
||||
|
||||
public async Task<BaseItemDto> GetChannelFolder(string userId, CancellationToken cancellationToken)
|
||||
{
|
||||
var user = string.IsNullOrEmpty(userId) ? null : _userManager.GetUserById(new Guid(userId));
|
||||
var user = string.IsNullOrEmpty(userId) ? null : _userManager.GetUserById(userId);
|
||||
|
||||
// Get everything
|
||||
var fields = Enum.GetNames(typeof(ItemFields)).Select(i => (ItemFields)Enum.Parse(typeof(ItemFields), i, true)).ToList();
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace MediaBrowser.Server.Implementations.Connect
|
||||
{
|
||||
public class ConnectData
|
||||
@@ -13,5 +15,27 @@ namespace MediaBrowser.Server.Implementations.Connect
|
||||
/// </summary>
|
||||
/// <value>The access key.</value>
|
||||
public string AccessKey { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the authorizations.
|
||||
/// </summary>
|
||||
/// <value>The authorizations.</value>
|
||||
public List<ConnectAuthorization> Authorizations { get; set; }
|
||||
|
||||
public ConnectData()
|
||||
{
|
||||
Authorizations = new List<ConnectAuthorization>();
|
||||
}
|
||||
}
|
||||
|
||||
public class ConnectAuthorization
|
||||
{
|
||||
public string LocalUserId { get; set; }
|
||||
public string AccessToken { get; set; }
|
||||
|
||||
public ConnectAuthorization()
|
||||
{
|
||||
AccessToken = new Guid().ToString("N");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,6 +3,8 @@ using MediaBrowser.Common.Net;
|
||||
using MediaBrowser.Controller;
|
||||
using MediaBrowser.Controller.Configuration;
|
||||
using MediaBrowser.Controller.Connect;
|
||||
using MediaBrowser.Controller.Entities;
|
||||
using MediaBrowser.Controller.Library;
|
||||
using MediaBrowser.Controller.Security;
|
||||
using MediaBrowser.Model.Logging;
|
||||
using MediaBrowser.Model.Net;
|
||||
@@ -27,9 +29,18 @@ namespace MediaBrowser.Server.Implementations.Connect
|
||||
private readonly IHttpClient _httpClient;
|
||||
private readonly IServerApplicationHost _appHost;
|
||||
private readonly IServerConfigurationManager _config;
|
||||
private readonly IUserManager _userManager;
|
||||
|
||||
public string ConnectServerId { get; set; }
|
||||
public string ConnectAccessKey { get; set; }
|
||||
private ConnectData _data = new ConnectData();
|
||||
|
||||
public string ConnectServerId
|
||||
{
|
||||
get { return _data.ServerId; }
|
||||
}
|
||||
public string ConnectAccessKey
|
||||
{
|
||||
get { return _data.AccessKey; }
|
||||
}
|
||||
|
||||
public string DiscoveredWanIpAddress { get; private set; }
|
||||
|
||||
@@ -47,7 +58,7 @@ namespace MediaBrowser.Server.Implementations.Connect
|
||||
return address;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public string WanApiAddress
|
||||
{
|
||||
get
|
||||
@@ -75,7 +86,7 @@ namespace MediaBrowser.Server.Implementations.Connect
|
||||
IEncryptionManager encryption,
|
||||
IHttpClient httpClient,
|
||||
IServerApplicationHost appHost,
|
||||
IServerConfigurationManager config)
|
||||
IServerConfigurationManager config, IUserManager userManager)
|
||||
{
|
||||
_logger = logger;
|
||||
_appPaths = appPaths;
|
||||
@@ -84,6 +95,7 @@ namespace MediaBrowser.Server.Implementations.Connect
|
||||
_httpClient = httpClient;
|
||||
_appHost = appHost;
|
||||
_config = config;
|
||||
_userManager = userManager;
|
||||
|
||||
LoadCachedData();
|
||||
}
|
||||
@@ -156,8 +168,8 @@ namespace MediaBrowser.Server.Implementations.Connect
|
||||
{
|
||||
var data = _json.DeserializeFromStream<ServerRegistrationResponse>(stream);
|
||||
|
||||
ConnectServerId = data.Id;
|
||||
ConnectAccessKey = data.AccessKey;
|
||||
_data.ServerId = data.Id;
|
||||
_data.AccessKey = data.AccessKey;
|
||||
|
||||
CacheData();
|
||||
}
|
||||
@@ -182,7 +194,7 @@ namespace MediaBrowser.Server.Implementations.Connect
|
||||
{"systemid", _appHost.SystemId}
|
||||
});
|
||||
|
||||
options.RequestHeaders.Add("X-Connect-Token", ConnectAccessKey);
|
||||
SetServerAccessToken(options);
|
||||
|
||||
// No need to examine the response
|
||||
using (var stream = (await _httpClient.Post(options).ConfigureAwait(false)).Content)
|
||||
@@ -203,11 +215,7 @@ namespace MediaBrowser.Server.Implementations.Connect
|
||||
{
|
||||
Directory.CreateDirectory(Path.GetDirectoryName(path));
|
||||
|
||||
var json = _json.SerializeToString(new ConnectData
|
||||
{
|
||||
AccessKey = ConnectAccessKey,
|
||||
ServerId = ConnectServerId
|
||||
});
|
||||
var json = _json.SerializeToString(_data);
|
||||
|
||||
var encrypted = _encryption.EncryptString(json);
|
||||
|
||||
@@ -229,10 +237,7 @@ namespace MediaBrowser.Server.Implementations.Connect
|
||||
|
||||
var json = _encryption.DecryptString(encrypted);
|
||||
|
||||
var data = _json.DeserializeFromString<ConnectData>(json);
|
||||
|
||||
ConnectAccessKey = data.AccessKey;
|
||||
ConnectServerId = data.ServerId;
|
||||
_data = _json.DeserializeFromString<ConnectData>(json);
|
||||
}
|
||||
catch (IOException)
|
||||
{
|
||||
@@ -244,9 +249,181 @@ namespace MediaBrowser.Server.Implementations.Connect
|
||||
}
|
||||
}
|
||||
|
||||
private User GetUser(string id)
|
||||
{
|
||||
var user = _userManager.GetUserById(id);
|
||||
|
||||
if (user == null)
|
||||
{
|
||||
throw new ArgumentException("User not found.");
|
||||
}
|
||||
|
||||
return user;
|
||||
}
|
||||
|
||||
public ConnectUserLink GetUserInfo(string userId)
|
||||
{
|
||||
var user = GetUser(userId);
|
||||
|
||||
return new ConnectUserLink
|
||||
{
|
||||
LocalUserId = user.Id.ToString("N"),
|
||||
Username = user.ConnectUserName,
|
||||
UserId = user.ConnectUserId
|
||||
};
|
||||
}
|
||||
|
||||
private string GetConnectUrl(string handler)
|
||||
{
|
||||
return "http://mb3admin.com/test/connect/" + handler;
|
||||
}
|
||||
|
||||
public async Task LinkUser(string userId, string connectUsername)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(connectUsername))
|
||||
{
|
||||
throw new ArgumentNullException("connectUsername");
|
||||
}
|
||||
|
||||
var connectUser = await GetConnectUser(new ConnectUserQuery
|
||||
{
|
||||
Name = connectUsername
|
||||
|
||||
}, CancellationToken.None).ConfigureAwait(false);
|
||||
|
||||
var user = GetUser(userId);
|
||||
|
||||
// See if it's already been set.
|
||||
if (string.Equals(connectUser.Id, user.ConnectUserId, StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(user.ConnectUserId))
|
||||
{
|
||||
await RemoveLink(user, connectUser).ConfigureAwait(false);
|
||||
}
|
||||
|
||||
var url = GetConnectUrl("ServerAuthorizations");
|
||||
|
||||
var options = new HttpRequestOptions
|
||||
{
|
||||
Url = url,
|
||||
CancellationToken = CancellationToken.None
|
||||
};
|
||||
|
||||
var accessToken = Guid.NewGuid().ToString("N");
|
||||
|
||||
var postData = new Dictionary<string, string>
|
||||
{
|
||||
{"serverId", ConnectServerId},
|
||||
{"userId", connectUser.Id},
|
||||
{"userType", "Linked"},
|
||||
{"accessToken", accessToken}
|
||||
};
|
||||
|
||||
options.SetPostData(postData);
|
||||
|
||||
SetServerAccessToken(options);
|
||||
|
||||
// No need to examine the response
|
||||
using (var stream = (await _httpClient.Post(options).ConfigureAwait(false)).Content)
|
||||
{
|
||||
}
|
||||
|
||||
user.ConnectAccessKey = accessToken;
|
||||
user.ConnectUserName = connectUser.Name;
|
||||
user.ConnectUserId = connectUser.Id;
|
||||
|
||||
await user.UpdateToRepository(ItemUpdateType.MetadataEdit, CancellationToken.None).ConfigureAwait(false);
|
||||
}
|
||||
|
||||
public async Task RemoveLink(string userId)
|
||||
{
|
||||
var user = GetUser(userId);
|
||||
|
||||
var connectUser = await GetConnectUser(new ConnectUserQuery
|
||||
{
|
||||
Name = user.ConnectUserId
|
||||
|
||||
}, CancellationToken.None).ConfigureAwait(false);
|
||||
|
||||
await RemoveLink(user, connectUser).ConfigureAwait(false);
|
||||
}
|
||||
|
||||
public async Task RemoveLink(User user, ConnectUser connectUser)
|
||||
{
|
||||
var url = GetConnectUrl("ServerAuthorizations");
|
||||
|
||||
var options = new HttpRequestOptions
|
||||
{
|
||||
Url = url,
|
||||
CancellationToken = CancellationToken.None
|
||||
};
|
||||
|
||||
var postData = new Dictionary<string, string>
|
||||
{
|
||||
{"serverId", ConnectServerId},
|
||||
{"userId", connectUser.Id}
|
||||
};
|
||||
|
||||
options.SetPostData(postData);
|
||||
|
||||
SetServerAccessToken(options);
|
||||
|
||||
// No need to examine the response
|
||||
using (var stream = (await _httpClient.SendAsync(options, "DELETE").ConfigureAwait(false)).Content)
|
||||
{
|
||||
}
|
||||
|
||||
user.ConnectAccessKey = null;
|
||||
user.ConnectUserName = null;
|
||||
user.ConnectUserId = null;
|
||||
|
||||
await user.UpdateToRepository(ItemUpdateType.MetadataEdit, CancellationToken.None).ConfigureAwait(false);
|
||||
}
|
||||
|
||||
private async Task<ConnectUser> GetConnectUser(ConnectUserQuery query, CancellationToken cancellationToken)
|
||||
{
|
||||
var url = GetConnectUrl("user");
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(query.Id))
|
||||
{
|
||||
url = url + "?id=" + WebUtility.UrlEncode(query.Id);
|
||||
}
|
||||
else if (!string.IsNullOrWhiteSpace(query.Name))
|
||||
{
|
||||
url = url + "?name=" + WebUtility.UrlEncode(query.Name);
|
||||
}
|
||||
else if (!string.IsNullOrWhiteSpace(query.Email))
|
||||
{
|
||||
url = url + "?email=" + WebUtility.UrlEncode(query.Email);
|
||||
}
|
||||
|
||||
var options = new HttpRequestOptions
|
||||
{
|
||||
CancellationToken = cancellationToken,
|
||||
Url = url
|
||||
};
|
||||
|
||||
SetServerAccessToken(options);
|
||||
|
||||
using (var stream = await _httpClient.Get(options).ConfigureAwait(false))
|
||||
{
|
||||
var response = _json.DeserializeFromStream<GetConnectUserResponse>(stream);
|
||||
|
||||
return new ConnectUser
|
||||
{
|
||||
Email = response.Email,
|
||||
Id = response.Id,
|
||||
Name = response.Name
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
private void SetServerAccessToken(HttpRequestOptions options)
|
||||
{
|
||||
options.RequestHeaders.Add("X-Connect-Token", ConnectAccessKey);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,4 +15,14 @@ namespace MediaBrowser.Server.Implementations.Connect
|
||||
public string Url { get; set; }
|
||||
public string Name { get; set; }
|
||||
}
|
||||
|
||||
public class GetConnectUserResponse
|
||||
{
|
||||
public string Id { get; set; }
|
||||
public string Name { get; set; }
|
||||
public string DisplayName { get; set; }
|
||||
public string Email { get; set; }
|
||||
public string IsActive { get; set; }
|
||||
public string ImageUrl { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -69,7 +69,7 @@ namespace MediaBrowser.Server.Implementations.HttpServer.Security
|
||||
|
||||
var user = string.IsNullOrWhiteSpace(auth.UserId)
|
||||
? null
|
||||
: UserManager.GetUserById(new Guid(auth.UserId));
|
||||
: UserManager.GetUserById(auth.UserId);
|
||||
|
||||
if (user == null & !string.IsNullOrWhiteSpace(auth.UserId))
|
||||
{
|
||||
|
||||
@@ -39,7 +39,7 @@ namespace MediaBrowser.Server.Implementations.Library
|
||||
}
|
||||
else
|
||||
{
|
||||
var user = _userManager.GetUserById(new Guid(query.UserId));
|
||||
var user = _userManager.GetUserById(query.UserId);
|
||||
|
||||
inputItems = user.RootFolder.GetRecursiveChildren(user, true);
|
||||
}
|
||||
|
||||
@@ -128,6 +128,16 @@ namespace MediaBrowser.Server.Implementations.Library
|
||||
return Users.FirstOrDefault(u => u.Id == id);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the user by identifier.
|
||||
/// </summary>
|
||||
/// <param name="id">The identifier.</param>
|
||||
/// <returns>User.</returns>
|
||||
public User GetUserById(string id)
|
||||
{
|
||||
return GetUserById(new Guid(id));
|
||||
}
|
||||
|
||||
public async Task Initialize()
|
||||
{
|
||||
Users = await LoadUsers().ConfigureAwait(false);
|
||||
@@ -219,6 +229,9 @@ namespace MediaBrowser.Server.Implementations.Library
|
||||
await UserRepository.SaveUser(user, CancellationToken.None).ConfigureAwait(false);
|
||||
|
||||
users.Add(user);
|
||||
|
||||
user.Configuration.IsAdministrator = true;
|
||||
UpdateConfiguration(user, user.Configuration);
|
||||
}
|
||||
|
||||
return users;
|
||||
@@ -503,7 +516,8 @@ namespace MediaBrowser.Server.Implementations.Library
|
||||
Name = name,
|
||||
Id = ("MBUser" + name).GetMD5(),
|
||||
DateCreated = DateTime.UtcNow,
|
||||
DateModified = DateTime.UtcNow
|
||||
DateModified = DateTime.UtcNow,
|
||||
UsesIdForConfigurationPath = true
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -47,7 +47,7 @@ namespace MediaBrowser.Server.Implementations.Library
|
||||
|
||||
public async Task<IEnumerable<Folder>> GetUserViews(UserViewQuery query, CancellationToken cancellationToken)
|
||||
{
|
||||
var user = _userManager.GetUserById(new Guid(query.UserId));
|
||||
var user = _userManager.GetUserById(query.UserId);
|
||||
|
||||
var folders = user.RootFolder
|
||||
.GetChildren(user, true)
|
||||
|
||||
@@ -133,7 +133,7 @@ namespace MediaBrowser.Server.Implementations.LiveTv
|
||||
|
||||
public async Task<QueryResult<LiveTvChannel>> GetInternalChannels(LiveTvChannelQuery query, CancellationToken cancellationToken)
|
||||
{
|
||||
var user = string.IsNullOrEmpty(query.UserId) ? null : _userManager.GetUserById(new Guid(query.UserId));
|
||||
var user = string.IsNullOrEmpty(query.UserId) ? null : _userManager.GetUserById(query.UserId);
|
||||
|
||||
var channels = _channelIdList.Select(_libraryManager.GetItemById)
|
||||
.Where(i => i != null)
|
||||
@@ -231,7 +231,7 @@ namespace MediaBrowser.Server.Implementations.LiveTv
|
||||
|
||||
public async Task<QueryResult<ChannelInfoDto>> GetChannels(LiveTvChannelQuery query, CancellationToken cancellationToken)
|
||||
{
|
||||
var user = string.IsNullOrEmpty(query.UserId) ? null : _userManager.GetUserById(new Guid(query.UserId));
|
||||
var user = string.IsNullOrEmpty(query.UserId) ? null : _userManager.GetUserById(query.UserId);
|
||||
|
||||
var internalResult = await GetInternalChannels(query, cancellationToken).ConfigureAwait(false);
|
||||
|
||||
@@ -693,7 +693,7 @@ namespace MediaBrowser.Server.Implementations.LiveTv
|
||||
});
|
||||
}
|
||||
|
||||
var user = string.IsNullOrEmpty(query.UserId) ? null : _userManager.GetUserById(new Guid(query.UserId));
|
||||
var user = string.IsNullOrEmpty(query.UserId) ? null : _userManager.GetUserById(query.UserId);
|
||||
|
||||
if (user != null)
|
||||
{
|
||||
@@ -730,7 +730,7 @@ namespace MediaBrowser.Server.Implementations.LiveTv
|
||||
{
|
||||
IEnumerable<LiveTvProgram> programs = _programs.Values;
|
||||
|
||||
var user = _userManager.GetUserById(new Guid(query.UserId));
|
||||
var user = _userManager.GetUserById(query.UserId);
|
||||
|
||||
// Avoid implicitly captured closure
|
||||
var currentUser = user;
|
||||
@@ -786,7 +786,7 @@ namespace MediaBrowser.Server.Implementations.LiveTv
|
||||
{
|
||||
var internalResult = await GetRecommendedProgramsInternal(query, cancellationToken).ConfigureAwait(false);
|
||||
|
||||
var user = _userManager.GetUserById(new Guid(query.UserId));
|
||||
var user = _userManager.GetUserById(query.UserId);
|
||||
|
||||
var returnArray = internalResult.Items
|
||||
.Select(i =>
|
||||
@@ -1099,7 +1099,7 @@ namespace MediaBrowser.Server.Implementations.LiveTv
|
||||
};
|
||||
}
|
||||
|
||||
var user = string.IsNullOrEmpty(query.UserId) ? null : _userManager.GetUserById(new Guid(query.UserId));
|
||||
var user = string.IsNullOrEmpty(query.UserId) ? null : _userManager.GetUserById(query.UserId);
|
||||
|
||||
var recordings = await service.GetRecordingsAsync(cancellationToken).ConfigureAwait(false);
|
||||
|
||||
@@ -1199,7 +1199,7 @@ namespace MediaBrowser.Server.Implementations.LiveTv
|
||||
};
|
||||
}
|
||||
|
||||
var user = string.IsNullOrEmpty(query.UserId) ? null : _userManager.GetUserById(new Guid(query.UserId));
|
||||
var user = string.IsNullOrEmpty(query.UserId) ? null : _userManager.GetUserById(query.UserId);
|
||||
|
||||
var internalResult = await GetInternalRecordings(query, cancellationToken).ConfigureAwait(false);
|
||||
|
||||
@@ -1869,7 +1869,7 @@ namespace MediaBrowser.Server.Implementations.LiveTv
|
||||
|
||||
public async Task<BaseItemDto> GetLiveTvFolder(string userId, CancellationToken cancellationToken)
|
||||
{
|
||||
var user = string.IsNullOrEmpty(userId) ? null : _userManager.GetUserById(new Guid(userId));
|
||||
var user = string.IsNullOrEmpty(userId) ? null : _userManager.GetUserById(userId);
|
||||
|
||||
// Get everything
|
||||
var fields = Enum.GetNames(typeof(ItemFields)).Select(i => (ItemFields)Enum.Parse(typeof(ItemFields), i, true)).ToList();
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
"FileNotFound": "File not found.",
|
||||
"FileReadError": "An error occurred while reading the file.",
|
||||
"DeleteUser": "Delete User",
|
||||
"DeleteUserConfirmation": "Are you sure you wish to delete {0}?",
|
||||
"DeleteUserConfirmation": "Are you sure you wish to delete this user?",
|
||||
"PasswordResetHeader": "Password Reset",
|
||||
"PasswordResetComplete": "The password has been reset.",
|
||||
"PasswordResetConfirmation": "Are you sure you wish to reset the password?",
|
||||
@@ -450,5 +450,8 @@
|
||||
"MessageChangeRecurringPlanConfirm": "After completing this transaction you will need to cancel your previous recurring donation from within your PayPal account. Thank you for supporting Media Browser.",
|
||||
"MessageSupporterMembershipExpiredOn": "Your supporter membership expired on {0}.",
|
||||
"MessageYouHaveALifetimeMembership": "You have a lifetime supporter membership. You can provide additional donations on a one-time or recurring basis using the options below. Thank you for supporting Media Browser.",
|
||||
"MessageYouHaveAnActiveRecurringMembership": "You have an active {0} membership. You can upgrade your plan using the options below."
|
||||
"MessageYouHaveAnActiveRecurringMembership": "You have an active {0} membership. You can upgrade your plan using the options below.",
|
||||
"ButtonDelete": "Delete",
|
||||
"HeaderMediaBrowserAccountAdded": "Media Browser Account Added",
|
||||
"MessageMediaBrowserAccontAdded": "A Media Browser account has been added to this user. An email has been sent to the owner of the account. They will need to confirm the invitation by clicking a link within the email."
|
||||
}
|
||||
|
||||
@@ -74,6 +74,8 @@
|
||||
"TabProfiles": "Profiles",
|
||||
"TabSecurity": "Security",
|
||||
"ButtonAddUser": "Add User",
|
||||
"ButtonAddLocalUser": "Add Local User",
|
||||
"ButtonInviteMediaBrowserUser": "Invite Media Browser User",
|
||||
"ButtonSave": "Save",
|
||||
"ButtonResetPassword": "Reset Password",
|
||||
"LabelNewPassword": "New password:",
|
||||
@@ -1156,5 +1158,7 @@
|
||||
"XmlDocumentAttributeListHelp": "These attributes are applied to the root element of every xml response.",
|
||||
"OptionSaveMetadataAsHidden": "Save metadata and images as hidden files",
|
||||
"LabelExtractChaptersDuringLibraryScan": "Extract chapter images during the library scan",
|
||||
"LabelExtractChaptersDuringLibraryScanHelp": "If enabled, chapter images will be extracted when videos are imported during the library scan. If disabled they will be extracted during the chapter images scheduled task, allowing the regular library scan to complete faster."
|
||||
"LabelExtractChaptersDuringLibraryScanHelp": "If enabled, chapter images will be extracted when videos are imported during the library scan. If disabled they will be extracted during the chapter images scheduled task, allowing the regular library scan to complete faster.",
|
||||
"LabelConnectUserName": "Media Browser username/email:",
|
||||
"LabelConnectUserNameHelp": "Connect this user to a Media Browser account to enable easy sign-in access from any app without having to know the server ip address."
|
||||
}
|
||||
|
||||
@@ -118,7 +118,7 @@
|
||||
<Compile Include="Configuration\ServerConfigurationManager.cs" />
|
||||
<Compile Include="Connect\ConnectData.cs" />
|
||||
<Compile Include="Connect\ConnectManager.cs" />
|
||||
<Compile Include="Connect\ServerRegistrationResponse.cs" />
|
||||
<Compile Include="Connect\Responses.cs" />
|
||||
<Compile Include="Drawing\ImageHeader.cs" />
|
||||
<Compile Include="Drawing\PercentPlayedDrawer.cs" />
|
||||
<Compile Include="Drawing\PlayedIndicatorDrawer.cs" />
|
||||
|
||||
@@ -44,7 +44,7 @@ namespace MediaBrowser.Server.Implementations.Notifications
|
||||
GetConfiguration().GetOptions(notificationType);
|
||||
|
||||
var users = GetUserIds(request, options)
|
||||
.Select(i => _userManager.GetUserById(new Guid(i)));
|
||||
.Select(i => _userManager.GetUserById(i));
|
||||
|
||||
var title = GetTitle(request, options);
|
||||
var description = GetDescription(request, options);
|
||||
|
||||
@@ -35,7 +35,7 @@ namespace MediaBrowser.Server.Implementations.Playlists
|
||||
|
||||
public IEnumerable<Playlist> GetPlaylists(string userId)
|
||||
{
|
||||
var user = _userManager.GetUserById(new Guid(userId));
|
||||
var user = _userManager.GetUserById(userId);
|
||||
|
||||
return GetPlaylistsFolder(userId).GetChildren(user, true).OfType<Playlist>();
|
||||
}
|
||||
@@ -100,7 +100,7 @@ namespace MediaBrowser.Server.Implementations.Playlists
|
||||
throw new ArgumentException("A playlist media type is required.");
|
||||
}
|
||||
|
||||
var user = _userManager.GetUserById(new Guid(options.UserId));
|
||||
var user = _userManager.GetUserById(options.UserId);
|
||||
|
||||
var path = Path.Combine(parentFolder.Path, folderName);
|
||||
path = GetTargetPath(path);
|
||||
@@ -162,7 +162,7 @@ namespace MediaBrowser.Server.Implementations.Playlists
|
||||
|
||||
public Task AddToPlaylist(string playlistId, IEnumerable<string> itemIds, string userId)
|
||||
{
|
||||
var user = string.IsNullOrWhiteSpace(userId) ? null : _userManager.GetUserById(new Guid(userId));
|
||||
var user = string.IsNullOrWhiteSpace(userId) ? null : _userManager.GetUserById(userId);
|
||||
|
||||
return AddToPlaylistInternal(playlistId, itemIds, user);
|
||||
}
|
||||
|
||||
@@ -455,7 +455,7 @@ namespace MediaBrowser.Server.Implementations.Session
|
||||
users.Add(user);
|
||||
|
||||
var additionalUsers = session.AdditionalUsers
|
||||
.Select(i => _userManager.GetUserById(new Guid(i.UserId)))
|
||||
.Select(i => _userManager.GetUserById(i.UserId))
|
||||
.Where(i => i != null);
|
||||
|
||||
users.AddRange(additionalUsers);
|
||||
@@ -1189,7 +1189,7 @@ namespace MediaBrowser.Server.Implementations.Session
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(info.UserId))
|
||||
{
|
||||
var user = _userManager.GetUserById(new Guid(info.UserId));
|
||||
var user = _userManager.GetUserById(info.UserId);
|
||||
|
||||
if (user == null || user.Configuration.IsDisabled)
|
||||
{
|
||||
|
||||
@@ -25,7 +25,7 @@ namespace MediaBrowser.Server.Implementations.TV
|
||||
|
||||
public QueryResult<BaseItem> GetNextUp(NextUpQuery request)
|
||||
{
|
||||
var user = _userManager.GetUserById(new Guid(request.UserId));
|
||||
var user = _userManager.GetUserById(request.UserId);
|
||||
|
||||
if (user == null)
|
||||
{
|
||||
@@ -47,7 +47,7 @@ namespace MediaBrowser.Server.Implementations.TV
|
||||
|
||||
public QueryResult<BaseItem> GetNextUp(NextUpQuery request, IEnumerable<Folder> parentsFolders)
|
||||
{
|
||||
var user = _userManager.GetUserById(new Guid(request.UserId));
|
||||
var user = _userManager.GetUserById(request.UserId);
|
||||
|
||||
if (user == null)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user