diff --git a/src/NzbDrone.Core/MediaFiles/BookImport/ImportApprovedBooks.cs b/src/NzbDrone.Core/MediaFiles/BookImport/ImportApprovedBooks.cs index 5b06fd726..145be9021 100644 --- a/src/NzbDrone.Core/MediaFiles/BookImport/ImportApprovedBooks.cs +++ b/src/NzbDrone.Core/MediaFiles/BookImport/ImportApprovedBooks.cs @@ -110,10 +110,10 @@ namespace NzbDrone.Core.MediaFiles.BookImport continue; } - if (replaceExisting) - { - RemoveExistingTrackFiles(author, book); - } + // if (replaceExisting) + // { + // RemoveExistingTrackFiles(author, book); + // } // set the correct release to be monitored before importing the new files var newRelease = albumDecision.First().Item.Edition; diff --git a/src/NzbDrone.Core/MediaFiles/UpgradeMediaFileService.cs b/src/NzbDrone.Core/MediaFiles/UpgradeMediaFileService.cs index b1cb9706c..0ff4baf8e 100644 --- a/src/NzbDrone.Core/MediaFiles/UpgradeMediaFileService.cs +++ b/src/NzbDrone.Core/MediaFiles/UpgradeMediaFileService.cs @@ -75,7 +75,7 @@ namespace NzbDrone.Core.MediaFiles if (_diskProvider.FileExists(bookFilePath)) { - _logger.Debug("Removing existing book file: {0}", file); + _logger.Debug("Removing existing book file: {0} CalibreId: {1}", file, file.CalibreId); if (!isCalibre) { @@ -83,12 +83,10 @@ namespace NzbDrone.Core.MediaFiles } else { - _calibre.RemoveFormats(file.CalibreId, - new[] - { - Path.GetExtension(bookFile.Path) - }, - settings); + var existing = _calibre.GetBook(file.CalibreId, settings); + var existingFormats = existing.Formats.Keys; + _logger.Debug($"Removing existing formats {existingFormats.ConcatToString()} from calibre"); + _calibre.RemoveFormats(file.CalibreId, existingFormats, settings); } } @@ -126,7 +124,7 @@ namespace NzbDrone.Core.MediaFiles public BookFile CalibreAddAndConvert(BookFile file, CalibreSettings settings) { - _logger.Trace($"Importing to calibre: {file.Path}"); + _logger.Trace($"Importing to calibre: {file.Path} calibre id: {file.CalibreId}"); if (file.CalibreId == 0) {