Various bug fixes (#3667)
This commit is contained in:
parent
a1d3aef39b
commit
1ad8a360cb
17 changed files with 73 additions and 32 deletions
|
@ -8,6 +8,7 @@ using API.Data;
|
|||
using API.DTOs.Account;
|
||||
using API.Entities;
|
||||
using API.Errors;
|
||||
using API.Extensions;
|
||||
using Kavita.Common;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using Microsoft.AspNetCore.Identity;
|
||||
|
@ -78,8 +79,9 @@ public class AccountService : IAccountService
|
|||
}
|
||||
public async Task<IEnumerable<ApiException>> ValidateUsername(string username)
|
||||
{
|
||||
// Reverted because of https://go.microsoft.com/fwlink/?linkid=2129535
|
||||
if (await _userManager.Users.AnyAsync(x => x.NormalizedUserName != null
|
||||
&& x.NormalizedUserName.Equals(username, StringComparison.CurrentCultureIgnoreCase)))
|
||||
&& x.NormalizedUserName == username.ToUpper()))
|
||||
{
|
||||
return
|
||||
[
|
||||
|
|
|
@ -363,16 +363,15 @@ public class ArchiveService : IArchiveService
|
|||
tempPath = Path.Join(tempLocation, parentDirectory ?? _directoryService.FileSystem.FileInfo.New(path).Name);
|
||||
}
|
||||
|
||||
progressCallback(Tuple.Create(_directoryService.FileSystem.FileInfo.New(path).Name, (1.0f * totalFiles) / count));
|
||||
if (Tasks.Scanner.Parser.Parser.IsArchive(path))
|
||||
{
|
||||
ExtractArchive(path, tempPath);
|
||||
}
|
||||
else
|
||||
{
|
||||
_directoryService.CopyFileToDirectory(path, tempPath);
|
||||
// Archives don't need to be put into a subdirectory of the same name
|
||||
tempPath = _directoryService.GetParentDirectoryName(tempPath);
|
||||
}
|
||||
|
||||
progressCallback(Tuple.Create(_directoryService.FileSystem.FileInfo.New(path).Name, (1.0f * totalFiles) / count));
|
||||
|
||||
_directoryService.CopyFileToDirectory(path, tempPath);
|
||||
count++;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue