diff --git a/client/components/stats/PreviewIcons.vue b/client/components/stats/PreviewIcons.vue
index 918c1294..d96f0593 100644
--- a/client/components/stats/PreviewIcons.vue
+++ b/client/components/stats/PreviewIcons.vue
@@ -5,7 +5,7 @@
{{ totalBooks }}
+{{ totalItems }}
Books in Library
{{ totalAudiobookHours }}
+{{ totalHours }}
Overall Hours
{{ Math.round((100 * genre.count) / totalBooks) }} %
+{{ Math.round((100 * genre.count) / totalItems) }} %
{{ genre.genre }}
No Audiobooks
- +No Items
+{{ index + 1 }}. {{ ab.title }}
{{ (ab.duration / 3600).toFixed(1) }}
@@ -77,8 +77,8 @@ export default { user() { return this.$store.state.user.user }, - totalBooks() { - return this.libraryStats ? this.libraryStats.totalBooks : 0 + totalItems() { + return this.libraryStats ? this.libraryStats.totalItems : 0 }, genresWithCount() { return this.libraryStats ? this.libraryStats.genresWithCount : [] @@ -86,12 +86,12 @@ export default { top5Genres() { return this.genresWithCount.slice(0, 5) }, - top10LongestAudiobooks() { - return this.libraryStats ? this.libraryStats.longestAudiobooks || [] : [] + top10LongestItems() { + return this.libraryStats ? this.libraryStats.longestItems || [] : [] }, - longestAudiobookDuration() { - if (!this.top10LongestAudiobooks.length) return 0 - return this.top10LongestAudiobooks[0].duration + longestItemDuration() { + if (!this.top10LongestItems.length) return 0 + return this.top10LongestItems[0].duration }, authorsWithCount() { return this.libraryStats ? this.libraryStats.authorsWithCount : [] diff --git a/client/pages/config/stats.vue b/client/pages/config/stats.vue index 758827fd..a4f20410 100644 --- a/client/pages/config/stats.vue +++ b/client/pages/config/stats.vue @@ -59,8 +59,8 @@ export default { data() { return { - listeningStats: null, - libraryStats: null + listeningStats: null + // libraryStats: null } }, watch: { @@ -103,11 +103,11 @@ export default { }, methods: { async init() { - this.libraryStats = await this.$axios.$get(`/api/libraries/${this.currentLibraryId}/stats`).catch((err) => { - console.error('Failed to get library stats', err) - var errorMsg = err.response ? err.response.data || 'Unknown Error' : 'Unknown Error' - this.$toast.error(`Failed to get library stats: ${errorMsg}`) - }) + // this.libraryStats = await this.$axios.$get(`/api/libraries/${this.currentLibraryId}/stats`).catch((err) => { + // console.error('Failed to get library stats', err) + // var errorMsg = err.response ? err.response.data || 'Unknown Error' : 'Unknown Error' + // this.$toast.error(`Failed to get library stats: ${errorMsg}`) + // }) this.listeningStats = await this.$axios.$get(`/api/me/listening-stats`).catch((err) => { console.error('Failed to load listening sesions', err) return [] diff --git a/client/pages/config/users/_id.vue b/client/pages/config/users/_id.vue index c4726ca5..7b77915c 100644 --- a/client/pages/config/users/_id.vue +++ b/client/pages/config/users/_id.vue @@ -43,11 +43,11 @@{{ ab.book ? ab.book.title : ab.audiobookTitle || 'Unknown' }}
-by {{ ab.book.author }}
+{{ ab.media && ab.media.metadata ? ab.media.metadata.title : ab.audiobookTitle || 'Unknown' }}
+by {{ ab.media.metadata.authorName }}