Download Bugfix (#2601)

This commit is contained in:
Joe Milazzo 2024-01-11 18:59:29 -06:00 committed by GitHub
parent e215305700
commit 51e169ed82
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 6 additions and 12 deletions

View file

@ -335,7 +335,7 @@ public class ArchiveService : IArchiveService
{
var dateString = DateTime.UtcNow.ToShortDateString().Replace("/", "_");
var potentialExistingFile = _directoryService.FileSystem.FileInfo.New(Path.Join(_directoryService.TempDirectory, $"kavita_{tempFolder}_{dateString}.zip"));
var potentialExistingFile = _directoryService.FileSystem.FileInfo.New(Path.Join(_directoryService.TempDirectory, $"kavita_{tempFolder}_{dateString}.cbz"));
if (potentialExistingFile.Exists)
{
// A previous download exists, just return it immediately
@ -352,7 +352,6 @@ public class ArchiveService : IArchiveService
foreach (var path in files)
{
var tempPath = Path.Join(tempLocation, _directoryService.FileSystem.Path.GetFileNameWithoutExtension(_directoryService.FileSystem.FileInfo.New(path).Name));
_directoryService.ExistOrCreate(tempPath);
progressCallback(Tuple.Create(_directoryService.FileSystem.FileInfo.New(path).Name, (1.0f * totalFiles) / count));
ExtractArchive(path, tempPath);
count++;
@ -363,7 +362,7 @@ public class ArchiveService : IArchiveService
throw new KavitaException("bad-copy-files-for-download");
}
var zipPath = Path.Join(_directoryService.TempDirectory, $"kavita_{tempFolder}_{dateString}.zip");
var zipPath = Path.Join(_directoryService.TempDirectory, $"kavita_{tempFolder}_{dateString}.cbz");
try
{
ZipFile.CreateFromDirectory(tempLocation, zipPath);