From f2d9de5a5fd920b9a7f1bd40f981468de3f18f82 Mon Sep 17 00:00:00 2001 From: advplyr Date: Wed, 20 Apr 2022 18:43:39 -0500 Subject: [PATCH] Library stats page links to genres, authors, items #453, use overall days when hours > 10000 --- client/components/stats/PreviewIcons.vue | 16 +++++++++++----- client/pages/config/library-stats.vue | 14 ++++++++++---- server/utils/libraryHelpers.js | 5 +++-- 3 files changed, 24 insertions(+), 11 deletions(-) diff --git a/client/components/stats/PreviewIcons.vue b/client/components/stats/PreviewIcons.vue index d96f0593..2504b6d8 100644 --- a/client/components/stats/PreviewIcons.vue +++ b/client/components/stats/PreviewIcons.vue @@ -6,15 +6,15 @@

{{ totalItems }}

-

Books in Library

+

Items in Library

show_chart
-

{{ totalHours }}

-

Overall Hours

+

{{ totalTime }}

+

Overall {{ useOverallHours ? 'Hours' : 'Days' }}

@@ -74,8 +74,7 @@ export default { return this.libraryStats ? this.libraryStats.totalDuration : 0 }, totalHours() { - var totalHours = Math.round(this.totalDuration / (60 * 60)) - return totalHours + return Math.round(this.totalDuration / (60 * 60)) }, totalSizePretty() { var totalSize = this.libraryStats ? this.libraryStats.totalSize : 0 @@ -86,6 +85,13 @@ export default { }, totalSizeMod() { return this.totalSizePretty.split(' ')[1] + }, + useOverallHours() { + return this.totalHours < 10000 + }, + totalTime() { + if (this.useOverallHours) return this.totalHours + return Math.round(this.totalHours / 24) } }, methods: {}, diff --git a/client/pages/config/library-stats.vue b/client/pages/config/library-stats.vue index f2e44b07..3485dd81 100644 --- a/client/pages/config/library-stats.vue +++ b/client/pages/config/library-stats.vue @@ -13,7 +13,9 @@

{{ Math.round((100 * genre.count) / totalItems) }} %

-

{{ genre.genre }}

+ + {{ genre.genre }} +
@@ -25,9 +27,11 @@

Top 10 Authors

No Authors