mirror of https://github.com/jellyfin/jellyfin.git
sync updates
This commit is contained in:
parent
cfa2e5ed1d
commit
10cfb3c43c
|
@ -365,9 +365,7 @@ namespace MediaBrowser.Api
|
||||||
throw new ResourceNotFoundException("User not found");
|
throw new ResourceNotFoundException("User not found");
|
||||||
}
|
}
|
||||||
|
|
||||||
var auth = AuthorizationContext.GetAuthorizationInfo(Request);
|
var result = _userManager.GetOfflineUserDto(user);
|
||||||
|
|
||||||
var result = _userManager.GetOfflineUserDto(user, auth.DeviceId);
|
|
||||||
|
|
||||||
return ToOptimizedResult(result);
|
return ToOptimizedResult(result);
|
||||||
}
|
}
|
||||||
|
|
|
@ -169,24 +169,27 @@ namespace MediaBrowser.Common.Implementations.Networking
|
||||||
IPAddress address;
|
IPAddress address;
|
||||||
if (resolveHost && !IPAddress.TryParse(endpoint, out address))
|
if (resolveHost && !IPAddress.TryParse(endpoint, out address))
|
||||||
{
|
{
|
||||||
var host = new Uri(endpoint).DnsSafeHost;
|
Uri uri;
|
||||||
|
if (Uri.TryCreate(endpoint, UriKind.RelativeOrAbsolute, out uri))
|
||||||
Logger.Debug("Resolving host {0}", host);
|
|
||||||
|
|
||||||
try
|
|
||||||
{
|
{
|
||||||
address = GetIpAddresses(host).FirstOrDefault();
|
var host = uri.DnsSafeHost;
|
||||||
|
Logger.Debug("Resolving host {0}", host);
|
||||||
|
|
||||||
if (address != null)
|
try
|
||||||
{
|
{
|
||||||
Logger.Debug("{0} resolved to {1}", host, address);
|
address = GetIpAddresses(host).FirstOrDefault();
|
||||||
|
|
||||||
return IsInLocalNetworkInternal(address.ToString(), false);
|
if (address != null)
|
||||||
|
{
|
||||||
|
Logger.Debug("{0} resolved to {1}", host, address);
|
||||||
|
|
||||||
|
return IsInLocalNetworkInternal(address.ToString(), false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
Logger.ErrorException("Error resovling hostname {0}", ex, host);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
catch (Exception ex)
|
|
||||||
{
|
|
||||||
Logger.ErrorException("Error resovling hostname {0}", ex, host);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -121,9 +121,8 @@ namespace MediaBrowser.Controller.Library
|
||||||
/// Gets the offline user dto.
|
/// Gets the offline user dto.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="user">The user.</param>
|
/// <param name="user">The user.</param>
|
||||||
/// <param name="deviceId">The device identifier.</param>
|
|
||||||
/// <returns>UserDto.</returns>
|
/// <returns>UserDto.</returns>
|
||||||
UserDto GetOfflineUserDto(User user, string deviceId);
|
UserDto GetOfflineUserDto(User user);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Resets the easy password.
|
/// Resets the easy password.
|
||||||
|
|
|
@ -61,6 +61,12 @@ namespace MediaBrowser.Model.Dto
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <value>The offline password.</value>
|
/// <value>The offline password.</value>
|
||||||
public string OfflinePassword { get; set; }
|
public string OfflinePassword { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets the offline password salt.
|
||||||
|
/// </summary>
|
||||||
|
/// <value>The offline password salt.</value>
|
||||||
|
public string OfflinePasswordSalt { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets or sets the primary image tag.
|
/// Gets or sets the primary image tag.
|
||||||
|
|
|
@ -402,15 +402,17 @@ namespace MediaBrowser.Server.Implementations.Library
|
||||||
return dto;
|
return dto;
|
||||||
}
|
}
|
||||||
|
|
||||||
public UserDto GetOfflineUserDto(User user, string deviceId)
|
public UserDto GetOfflineUserDto(User user)
|
||||||
{
|
{
|
||||||
var dto = GetUserDto(user);
|
var dto = GetUserDto(user);
|
||||||
|
|
||||||
var offlinePasswordHash = GetLocalPasswordHash(user);
|
var offlinePasswordHash = GetLocalPasswordHash(user);
|
||||||
dto.HasPassword = !IsPasswordEmpty(offlinePasswordHash);
|
dto.HasPassword = !IsPasswordEmpty(offlinePasswordHash);
|
||||||
|
|
||||||
|
dto.OfflinePasswordSalt = Guid.NewGuid().ToString("N");
|
||||||
|
|
||||||
// Hash the pin with the device Id to create a unique result for this device
|
// Hash the pin with the device Id to create a unique result for this device
|
||||||
dto.OfflinePassword = GetSha1String((offlinePasswordHash + deviceId).ToLower());
|
dto.OfflinePassword = GetSha1String((offlinePasswordHash + dto.OfflinePasswordSalt).ToLower());
|
||||||
|
|
||||||
dto.ServerName = _appHost.FriendlyName;
|
dto.ServerName = _appHost.FriendlyName;
|
||||||
|
|
||||||
|
|
|
@ -86,7 +86,8 @@ namespace MediaBrowser.Server.Implementations.Library
|
||||||
list.Add(await GetUserView(CollectionType.Movies, string.Empty, cancellationToken).ConfigureAwait(false));
|
list.Add(await GetUserView(CollectionType.Movies, string.Empty, cancellationToken).ConfigureAwait(false));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (foldersWithViewTypes.Any(i => string.Equals(i.CollectionType, CollectionType.Games, StringComparison.OrdinalIgnoreCase)))
|
if (foldersWithViewTypes.Any(i => string.Equals(i.CollectionType, CollectionType.Games, StringComparison.OrdinalIgnoreCase))
|
||||||
|
|| _config.Configuration.EnableLegacyCollections)
|
||||||
{
|
{
|
||||||
list.Add(await GetUserView(CollectionType.Games, string.Empty, cancellationToken).ConfigureAwait(false));
|
list.Add(await GetUserView(CollectionType.Games, string.Empty, cancellationToken).ConfigureAwait(false));
|
||||||
}
|
}
|
||||||
|
|
|
@ -33,16 +33,7 @@ namespace MediaBrowser.Server.Startup.Common.FFMpeg
|
||||||
case OperatingSystem.Linux:
|
case OperatingSystem.Linux:
|
||||||
|
|
||||||
info.ArchiveType = "7z";
|
info.ArchiveType = "7z";
|
||||||
|
info.Version = "20150124";
|
||||||
switch (environment.SystemArchitecture)
|
|
||||||
{
|
|
||||||
case Architecture.X86_X64:
|
|
||||||
info.Version = "20150124";
|
|
||||||
break;
|
|
||||||
case Architecture.X86:
|
|
||||||
info.Version = "20150124";
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
case OperatingSystem.Osx:
|
case OperatingSystem.Osx:
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
|
|
||||||
//[assembly: AssemblyVersion("3.0.*")]
|
[assembly: AssemblyVersion("3.0.*")]
|
||||||
[assembly: AssemblyVersion("3.0.5518.4")]
|
//[assembly: AssemblyVersion("3.0.5518.4")]
|
||||||
|
|
Loading…
Reference in New Issue