From 29c740418515afc96f577c67ab06af8cd63102e6 Mon Sep 17 00:00:00 2001 From: ta264 Date: Thu, 23 Dec 2021 21:41:43 +0000 Subject: [PATCH] Fixed: Send primary series to Calibre Fixes #1419 --- src/NzbDrone.Core/Books/Calibre/CalibreProxy.cs | 2 +- src/NzbDrone.Core/MediaFiles/EbookTagService.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/NzbDrone.Core/Books/Calibre/CalibreProxy.cs b/src/NzbDrone.Core/Books/Calibre/CalibreProxy.cs index f9e8029cf..30d9e2f42 100644 --- a/src/NzbDrone.Core/Books/Calibre/CalibreProxy.cs +++ b/src/NzbDrone.Core/Books/Calibre/CalibreProxy.cs @@ -214,7 +214,7 @@ namespace NzbDrone.Core.Books.Calibre { var edition = file.Edition.Value; var book = edition.Book.Value; - var serieslink = book.SeriesLinks.Value.FirstOrDefault(x => x.Series.Value.Title.IsNotNullOrWhiteSpace()); + var serieslink = book.SeriesLinks.Value.OrderBy(x => x.SeriesPosition).FirstOrDefault(x => x.Series.Value.Title.IsNotNullOrWhiteSpace()); var series = serieslink?.Series.Value; double? seriesIndex = null; diff --git a/src/NzbDrone.Core/MediaFiles/EbookTagService.cs b/src/NzbDrone.Core/MediaFiles/EbookTagService.cs index 367c3b25a..515624980 100644 --- a/src/NzbDrone.Core/MediaFiles/EbookTagService.cs +++ b/src/NzbDrone.Core/MediaFiles/EbookTagService.cs @@ -200,7 +200,7 @@ namespace NzbDrone.Core.MediaFiles { var edition = file.Edition.Value; var book = edition.Book.Value; - var serieslink = book.SeriesLinks.Value.FirstOrDefault(x => x.Series.Value.Title.IsNotNullOrWhiteSpace()); + var serieslink = book.SeriesLinks.Value.OrderBy(x => x.SeriesPosition).FirstOrDefault(x => x.Series.Value.Title.IsNotNullOrWhiteSpace()); var series = serieslink?.Series.Value; double? seriesIndex = null;