From 324db4959d1dab8256290d94eedbbd37436c9aa2 Mon Sep 17 00:00:00 2001 From: Thomas Mathews Date: Mon, 25 May 2020 15:12:23 +0100 Subject: [PATCH] Fixed: bookshelf count and colour (#30) * Add total book count to the result set from the statistics query * Rename TotalTrackCount and map it * Fix the colouring of the book count/percentage --- src/NzbDrone.Core/AuthorStats/BookStatistics.cs | 1 + src/Readarr.Api.V1/Books/BookStatisticsResource.cs | 7 ++++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/NzbDrone.Core/AuthorStats/BookStatistics.cs b/src/NzbDrone.Core/AuthorStats/BookStatistics.cs index 3e5f1b9a5..313d9e69d 100644 --- a/src/NzbDrone.Core/AuthorStats/BookStatistics.cs +++ b/src/NzbDrone.Core/AuthorStats/BookStatistics.cs @@ -9,5 +9,6 @@ namespace NzbDrone.Core.AuthorStats public int BookFileCount { get; set; } public int BookCount { get; set; } public long SizeOnDisk { get; set; } + public int TotalBookCount { get; set; } } } diff --git a/src/Readarr.Api.V1/Books/BookStatisticsResource.cs b/src/Readarr.Api.V1/Books/BookStatisticsResource.cs index 79ad8f07c..835ef148a 100644 --- a/src/Readarr.Api.V1/Books/BookStatisticsResource.cs +++ b/src/Readarr.Api.V1/Books/BookStatisticsResource.cs @@ -6,10 +6,10 @@ namespace Readarr.Api.V1.Books { public int BookFileCount { get; set; } public int BookCount { get; set; } - public int TotalTrackCount { get; set; } + public int TotalBookCount { get; set; } public long SizeOnDisk { get; set; } - public decimal PercentOfTracks + public decimal PercentOfBooks { get { @@ -36,7 +36,8 @@ namespace Readarr.Api.V1.Books { BookFileCount = model.BookFileCount, BookCount = model.BookCount, - SizeOnDisk = model.SizeOnDisk + SizeOnDisk = model.SizeOnDisk, + TotalBookCount = model.TotalBookCount }; } }