diff --git a/frontend/src/Author/Index/Overview/AuthorIndexOverview.js b/frontend/src/Author/Index/Overview/AuthorIndexOverview.js index c7d3ebde3..061fb77d3 100644 --- a/frontend/src/Author/Index/Overview/AuthorIndexOverview.js +++ b/frontend/src/Author/Index/Overview/AuthorIndexOverview.js @@ -90,7 +90,7 @@ class AuthorIndexOverview extends Component { status, titleSlug, nextAiring, - statistics, + statistics = {}, images, posterWidth, posterHeight, @@ -113,10 +113,11 @@ class AuthorIndexOverview extends Component { } = this.props; const { - bookCount, - sizeOnDisk, - bookFileCount, - totalBookCount + bookCount = 0, + availableBookCount = 0, + bookFileCount = 0, + totalBookCount = 0, + sizeOnDisk = 0 } = statistics; const { @@ -179,6 +180,7 @@ class AuthorIndexOverview extends Component { monitored={monitored} status={status} bookCount={bookCount} + availableBookCount={availableBookCount} bookFileCount={bookFileCount} totalBookCount={totalBookCount} posterWidth={posterWidth} diff --git a/frontend/src/Author/Index/Posters/AuthorIndexPoster.js b/frontend/src/Author/Index/Posters/AuthorIndexPoster.js index df929a2b2..75bc7e7e1 100644 --- a/frontend/src/Author/Index/Posters/AuthorIndexPoster.js +++ b/frontend/src/Author/Index/Posters/AuthorIndexPoster.js @@ -85,7 +85,7 @@ class AuthorIndexPoster extends Component { titleSlug, status, nextAiring, - statistics, + statistics = {}, images, posterWidth, posterHeight, @@ -110,10 +110,11 @@ class AuthorIndexPoster extends Component { } = this.props; const { - bookCount, - sizeOnDisk, - bookFileCount, - totalBookCount + bookCount = 0, + availableBookCount = 0, + bookFileCount = 0, + totalBookCount = 0, + sizeOnDisk = 0 } = statistics; const { @@ -213,6 +214,7 @@ class AuthorIndexPoster extends Component { monitored={monitored} status={status} bookCount={bookCount} + availableBookCount={availableBookCount} bookFileCount={bookFileCount} totalBookCount={totalBookCount} posterWidth={posterWidth} diff --git a/frontend/src/Author/Index/ProgressBar/AuthorIndexProgressBar.js b/frontend/src/Author/Index/ProgressBar/AuthorIndexProgressBar.js index d1e57a1df..7f91f92d8 100644 --- a/frontend/src/Author/Index/ProgressBar/AuthorIndexProgressBar.js +++ b/frontend/src/Author/Index/ProgressBar/AuthorIndexProgressBar.js @@ -11,14 +11,15 @@ function AuthorIndexProgressBar(props) { monitored, status, bookCount, + availableBookCount, bookFileCount, totalBookCount, posterWidth, detailedProgressBar } = props; - const progress = bookCount ? bookCount / totalBookCount * 100 : 100; - const text = `${bookCount} / ${totalBookCount}`; + const progress = bookCount ? (availableBookCount / bookCount) * 100 : 100; + const text = `${availableBookCount} / ${bookCount}`; return ( ); @@ -39,6 +40,7 @@ AuthorIndexProgressBar.propTypes = { monitored: PropTypes.bool.isRequired, status: PropTypes.string.isRequired, bookCount: PropTypes.number.isRequired, + availableBookCount: PropTypes.number.isRequired, bookFileCount: PropTypes.number.isRequired, totalBookCount: PropTypes.number.isRequired, posterWidth: PropTypes.number.isRequired, diff --git a/frontend/src/Author/Index/Table/AuthorIndexRow.js b/frontend/src/Author/Index/Table/AuthorIndexRow.js index 015db2ab4..6b13e0331 100644 --- a/frontend/src/Author/Index/Table/AuthorIndexRow.js +++ b/frontend/src/Author/Index/Table/AuthorIndexRow.js @@ -90,7 +90,7 @@ class AuthorIndexRow extends Component { nextBook, lastBook, added, - statistics, + statistics = {}, genres, ratings, path, @@ -110,10 +110,11 @@ class AuthorIndexRow extends Component { } = this.props; const { - bookCount, - bookFileCount, - totalBookCount, - sizeOnDisk + bookCount = 0, + availableBookCount = 0, + bookFileCount = 0, + totalBookCount = 0, + sizeOnDisk = 0 } = statistics; const { @@ -286,7 +287,7 @@ class AuthorIndexRow extends Component { } if (name === 'bookProgress') { - const progress = bookCount ? bookFileCount / bookCount * 100 : 100; + const progress = bookCount ? (availableBookCount / bookCount) * 100 : 100; return ( diff --git a/frontend/src/Book/Index/ProgressBar/BookIndexProgressBar.js b/frontend/src/Book/Index/ProgressBar/BookIndexProgressBar.js index dd5472e67..b8a995047 100644 --- a/frontend/src/Book/Index/ProgressBar/BookIndexProgressBar.js +++ b/frontend/src/Book/Index/ProgressBar/BookIndexProgressBar.js @@ -16,8 +16,8 @@ function BookIndexProgressBar(props) { detailedProgressBar } = props; - const progress = bookCount ? bookFileCount / totalBookCount * 100 : 0; - const text = `${bookFileCount} / ${bookCount}`; + const progress = bookFileCount && bookCount ? (totalBookCount / bookCount) * 100 : 0; + const text = `${bookFileCount ? bookCount : 0} / ${totalBookCount}`; return ( ); diff --git a/frontend/src/Bookshelf/BookshelfBook.js b/frontend/src/Bookshelf/BookshelfBook.js index da66534cc..db40c58f5 100644 --- a/frontend/src/Bookshelf/BookshelfBook.js +++ b/frontend/src/Bookshelf/BookshelfBook.js @@ -27,14 +27,15 @@ class BookshelfBook extends Component { title, disambiguation, monitored, - statistics, + statistics = {}, isSaving } = this.props; const { - bookFileCount, - totalBookCount, - percentOfBooks + bookCount = 0, + bookFileCount = 0, + totalBookCount = 0, + percentOfBooks = 0 } = statistics; return ( @@ -59,10 +60,14 @@ class BookshelfBook extends Component { percentOfBooks < 100 && monitored && styles.missingWanted, percentOfBooks === 100 && styles.allBooks )} - title={translate('BookFileCounttotalBookCountBooksDownloadedInterp', [bookFileCount, totalBookCount])} + title={translate('BookProgressBarText', { + bookCount: bookFileCount ? bookCount : 0, + bookFileCount, + totalBookCount + })} > { - totalBookCount === 0 ? '0/0' : `${bookFileCount}/${totalBookCount}` + totalBookCount === 0 ? '0/0' : `${bookFileCount ? bookCount : 0}/${totalBookCount}` } diff --git a/src/NzbDrone.Core/Localization/Core/en.json b/src/NzbDrone.Core/Localization/Core/en.json index acd6e2afe..0228eb863 100644 --- a/src/NzbDrone.Core/Localization/Core/en.json +++ b/src/NzbDrone.Core/Localization/Core/en.json @@ -59,6 +59,7 @@ "AuthorFolderFormat": "Author Folder Format", "AuthorIndex": "Author Index", "AuthorNameHelpText": "The name of the author/book to exclude (can be anything meaningful)", + "AuthorProgressBarText": "{availableBookCount} / {bookCount} (Total: {totalBookCount}, Files: {bookFileCount})", "Authors": "Authors", "AutoAdd": "Auto Add", "AutoRedownloadFailed": "Redownload Failed", @@ -92,8 +93,6 @@ "Book": "Book", "BookAvailableButMissing": "Book Available, but Missing", "BookEditor": "Book Editor", - "BookFileCountBookCountTotalTotalBookCountInterp": "{0} / {1} (Total: {2})", - "BookFileCounttotalBookCountBooksDownloadedInterp": "{0}/{1} books downloaded", "BookFilesCountMessage": "No book files", "BookIndex": "Book Index", "BookIsDownloading": "Book is downloading", @@ -101,6 +100,7 @@ "BookList": "Book List", "BookMonitoring": "Book Monitoring", "BookNaming": "Book Naming", + "BookProgressBarText": "{bookCount} / {totalBookCount} (Files: {bookFileCount})", "BookStudio": "Book Studio", "BookTitle": "Book Title", "Books": "Books",