mirror of
https://github.com/Readarr/Readarr
synced 2026-01-11 01:53:37 +01:00
Fixed: Prevent renaming calibre files
This commit is contained in:
parent
dd341ef1e1
commit
e29b0c318e
2 changed files with 6 additions and 3 deletions
|
|
@ -1,4 +1,4 @@
|
|||
using System.Collections.Generic;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using FizzWare.NBuilder;
|
||||
using Moq;
|
||||
|
|
@ -26,6 +26,7 @@ public void Setup()
|
|||
_trackFiles = Builder<BookFile>.CreateListOfSize(2)
|
||||
.All()
|
||||
.With(e => e.Author = _author)
|
||||
.With(e => e.CalibreId = 0)
|
||||
.Build()
|
||||
.ToList();
|
||||
|
||||
|
|
|
|||
|
|
@ -71,7 +71,8 @@ public List<RenameBookFilePreview> GetRenamePreviews(int authorId, int bookId)
|
|||
|
||||
private IEnumerable<RenameBookFilePreview> GetPreviews(Author author, List<BookFile> files)
|
||||
{
|
||||
foreach (var f in files)
|
||||
// Don't rename Calibre files
|
||||
foreach (var f in files.Where(x => x.CalibreId == 0))
|
||||
{
|
||||
var file = f;
|
||||
var book = file.Edition.Value;
|
||||
|
|
@ -109,7 +110,8 @@ private void RenameFiles(List<BookFile> bookFiles, Author author)
|
|||
{
|
||||
var renamed = new List<BookFile>();
|
||||
|
||||
foreach (var bookFile in bookFiles)
|
||||
// Don't rename Calibre files
|
||||
foreach (var bookFile in bookFiles.Where(x => x.CalibreId == 0))
|
||||
{
|
||||
var bookFilePath = bookFile.Path;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue