mirror of
https://github.com/Kareadita/Kavita.git
synced 2025-07-09 03:04:19 -04:00
Bugfix/multiple file extract (#116)
* Fixed a bug where if a chapter had multiple archive files, they wouldn't all be extracted due to short circuit in ExtractArchive. Now I add the file id then flatten afterwards. * Fixed a bug where due to how we were extracting for multiple files, the single file extractions failed. * Bumped release for 3.5 release
This commit is contained in:
parent
280fdc07f2
commit
55d47eb1b9
@ -42,13 +42,18 @@ namespace API.Services
|
||||
{
|
||||
EnsureCacheDirectory();
|
||||
var chapter = await _unitOfWork.VolumeRepository.GetChapterAsync(chapterId);
|
||||
var fileCount = 0;
|
||||
var files = chapter.Files.ToList();
|
||||
var fileCount = files.Count;
|
||||
var extractPath = GetCachePath(chapterId);
|
||||
var extraPath = "";
|
||||
|
||||
foreach (var file in chapter.Files)
|
||||
foreach (var file in files)
|
||||
{
|
||||
_archiveService.ExtractArchive(file.FilePath, Path.Join(extractPath, file.Id + ""));
|
||||
fileCount++;
|
||||
if (fileCount > 1)
|
||||
{
|
||||
extraPath = file.Id + "";
|
||||
}
|
||||
_archiveService.ExtractArchive(file.FilePath, Path.Join(extractPath, extraPath));
|
||||
}
|
||||
|
||||
if (fileCount > 1)
|
||||
|
@ -136,7 +136,7 @@ namespace API
|
||||
applicationLifetime.ApplicationStopping.Register(OnShutdown);
|
||||
applicationLifetime.ApplicationStarted.Register(() =>
|
||||
{
|
||||
Console.WriteLine("Kavita - v0.3.1");
|
||||
Console.WriteLine("Kavita - v0.3.5");
|
||||
});
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user