mirror of
https://github.com/fergalmoran/Readarr.git
synced 2026-02-27 10:14:57 +00:00
Fixed: Prevent renaming calibre files
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using FizzWare.NBuilder;
|
||||
using Moq;
|
||||
@@ -26,6 +26,7 @@ namespace NzbDrone.Core.Test.MediaFiles
|
||||
_trackFiles = Builder<BookFile>.CreateListOfSize(2)
|
||||
.All()
|
||||
.With(e => e.Author = _author)
|
||||
.With(e => e.CalibreId = 0)
|
||||
.Build()
|
||||
.ToList();
|
||||
|
||||
|
||||
@@ -71,7 +71,8 @@ namespace NzbDrone.Core.MediaFiles
|
||||
|
||||
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 @@ namespace NzbDrone.Core.MediaFiles
|
||||
{
|
||||
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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user