mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-04-22 18:14:42 +01:00
fix web socket session creation
This commit is contained in:
@@ -695,7 +695,7 @@ namespace MediaBrowser.Server.Implementations.Library
|
||||
|
||||
public IEnumerable<BaseItem> ResolvePaths(IEnumerable<FileSystemMetadata> files,
|
||||
IDirectoryService directoryService,
|
||||
Folder parent,
|
||||
Folder parent,
|
||||
LibraryOptions libraryOptions,
|
||||
string collectionType,
|
||||
IItemResolver[] resolvers)
|
||||
@@ -1490,10 +1490,10 @@ namespace MediaBrowser.Server.Implementations.Library
|
||||
|
||||
private void AddUserToQuery(InternalItemsQuery query, User user)
|
||||
{
|
||||
if (query.AncestorIds.Length == 0 &&
|
||||
!query.ParentId.HasValue &&
|
||||
query.ChannelIds.Length == 0 &&
|
||||
query.TopParentIds.Length == 0 &&
|
||||
if (query.AncestorIds.Length == 0 &&
|
||||
!query.ParentId.HasValue &&
|
||||
query.ChannelIds.Length == 0 &&
|
||||
query.TopParentIds.Length == 0 &&
|
||||
string.IsNullOrWhiteSpace(query.AncestorWithPresentationUniqueKey)
|
||||
&& query.ItemIds.Length == 0)
|
||||
{
|
||||
@@ -2552,7 +2552,7 @@ namespace MediaBrowser.Server.Implementations.Library
|
||||
throw new ArgumentNullException("to");
|
||||
}
|
||||
|
||||
var newPath = path.Replace(from, to, StringComparison.OrdinalIgnoreCase);
|
||||
var newPath = path.Replace(from.Trim(), to.Trim(), StringComparison.OrdinalIgnoreCase);
|
||||
|
||||
if (!string.Equals(newPath, path))
|
||||
{
|
||||
|
||||
@@ -1341,8 +1341,19 @@ namespace MediaBrowser.Server.Implementations.Session
|
||||
|
||||
private async Task<AuthenticationResult> AuthenticateNewSessionInternal(AuthenticationRequest request, bool enforcePassword)
|
||||
{
|
||||
var user = _userManager.Users
|
||||
.FirstOrDefault(i => string.Equals(request.Username, i.Name, StringComparison.OrdinalIgnoreCase));
|
||||
User user = null;
|
||||
if (!string.IsNullOrWhiteSpace(request.UserId))
|
||||
{
|
||||
var idGuid = new Guid(request.UserId);
|
||||
user = _userManager.Users
|
||||
.FirstOrDefault(i => i.Id == idGuid);
|
||||
}
|
||||
|
||||
if (user == null)
|
||||
{
|
||||
user = _userManager.Users
|
||||
.FirstOrDefault(i => string.Equals(request.Username, i.Name, StringComparison.OrdinalIgnoreCase));
|
||||
}
|
||||
|
||||
if (user != null && !string.IsNullOrWhiteSpace(request.DeviceId))
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user