From d5d03528d48c51c5ff01511ca7fdda996c6f0d51 Mon Sep 17 00:00:00 2001 From: Joseph Milazzo Date: Sat, 16 Oct 2021 11:24:30 -0700 Subject: [PATCH] Regression Fix (#680) * Ensure we mount the backups directory for Docker users * Fixed a huge logic bug that deleted files in users libraries --- API/Services/Tasks/Scanner/ParseScannedFiles.cs | 7 +++++-- entrypoint.sh | 14 ++++++++++++++ 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/API/Services/Tasks/Scanner/ParseScannedFiles.cs b/API/Services/Tasks/Scanner/ParseScannedFiles.cs index 111dc71af..f88caab89 100644 --- a/API/Services/Tasks/Scanner/ParseScannedFiles.cs +++ b/API/Services/Tasks/Scanner/ParseScannedFiles.cs @@ -74,9 +74,12 @@ namespace API.Services.Tasks.Scanner } // If we couldn't match, log. But don't log if the file parses as a cover image - if (info == null || !(Parser.Parser.IsImage(path) || Parser.Parser.IsCoverImage(path))) + if (info == null) { - _logger.LogWarning("[Scanner] Could not parse series from {Path}", path); + if (!(Parser.Parser.IsImage(path) && Parser.Parser.IsCoverImage(path))) + { + _logger.LogWarning("[Scanner] Could not parse series from {Path}", path); + } return; } diff --git a/entrypoint.sh b/entrypoint.sh index 283db922c..c0e61fdae 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -60,6 +60,20 @@ else ln -s /kavita/data/logs /kavita/logs fi +if [ -d /kavita/data/backups ] +then + if [ -d /kavita/backups ] + then + unlink /kavita/backups + ln -s /kavita/data/backups /kavita/backups + else + ln -s /kavita/data/backups /kavita/backups + fi +else + mkdir /kavita/data/backups + ln -s /kavita/data/backups /kavita/backups +fi + if [ -d /kavita/data/stats ] then if [ -d /kavita/stats ]