2021-11-14 02:17:33 +01:00
|
|
|
<template>
|
2024-04-19 00:45:47 +02:00
|
|
|
<div class="flex flex-wrap justify-center mt-6">
|
2024-04-19 00:30:06 +02:00
|
|
|
<div class="flex p-2">
|
|
|
|
<svg class="h-14 w-14" viewBox="0 0 24 24">
|
2021-11-14 02:17:33 +01:00
|
|
|
<path fill="currentColor" d="M9 3V18H12V3H9M12 5L16 18L19 17L15 4L12 5M5 5V18H8V5H5M3 19V21H21V19H3Z" />
|
|
|
|
</svg>
|
2024-04-19 00:30:06 +02:00
|
|
|
<div class="px-1">
|
|
|
|
<p class="text-4.5xl leading-none font-bold">{{ $formatNumber(totalItems) }}</p>
|
2023-02-11 22:02:56 +01:00
|
|
|
<p class="text-xs md:text-sm text-white text-opacity-80">{{ $strings.LabelStatsItemsInLibrary }}</p>
|
2021-11-14 02:17:33 +01:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
2024-04-19 00:30:06 +02:00
|
|
|
<div class="flex p-2">
|
|
|
|
<span class="material-icons text-5xl py-1">show_chart</span>
|
2021-11-14 02:17:33 +01:00
|
|
|
<div class="px-1">
|
2024-04-19 00:30:06 +02:00
|
|
|
<p class="text-4.5xl leading-none font-bold">{{ $formatNumber(totalTime) }}</p>
|
2023-02-11 22:02:56 +01:00
|
|
|
<p class="text-xs md:text-sm text-white text-opacity-80">{{ useOverallHours ? $strings.LabelStatsOverallHours : $strings.LabelStatsOverallDays }}</p>
|
2021-11-14 02:17:33 +01:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
2024-04-19 00:30:06 +02:00
|
|
|
<div v-if="isBookLibrary" class="flex p-2">
|
|
|
|
<svg class="h-14 w-14" viewBox="0 0 24 24">
|
2021-11-14 02:17:33 +01:00
|
|
|
<path fill="currentColor" d="M12,4A4,4 0 0,1 16,8A4,4 0 0,1 12,12A4,4 0 0,1 8,8A4,4 0 0,1 12,4M12,6A2,2 0 0,0 10,8A2,2 0 0,0 12,10A2,2 0 0,0 14,8A2,2 0 0,0 12,6M12,13C14.67,13 20,14.33 20,17V20H4V17C4,14.33 9.33,13 12,13M12,14.9C9.03,14.9 5.9,16.36 5.9,17V18.1H18.1V17C18.1,16.36 14.97,14.9 12,14.9Z" />
|
|
|
|
</svg>
|
|
|
|
<div class="px-1">
|
2024-04-19 00:30:06 +02:00
|
|
|
<p class="text-4.5xl leading-none font-bold">{{ $formatNumber(totalAuthors) }}</p>
|
2023-02-11 22:02:56 +01:00
|
|
|
<p class="text-xs md:text-sm text-white text-opacity-80">{{ $strings.LabelStatsAuthors }}</p>
|
2021-11-14 02:17:33 +01:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
2024-04-19 00:30:06 +02:00
|
|
|
<div class="flex p-2">
|
|
|
|
<span class="material-icons-outlined text-5xl pt-1">insert_drive_file</span>
|
2021-12-29 22:53:19 +01:00
|
|
|
<div class="px-1">
|
2024-04-19 00:30:06 +02:00
|
|
|
<p class="text-4.5xl leading-none font-bold">{{ $formatNumber(totalSizeNum) }}</p>
|
2023-02-11 22:02:56 +01:00
|
|
|
<p class="text-xs md:text-sm text-white text-opacity-80">{{ $strings.LabelSize }} ({{ totalSizeMod }})</p>
|
2021-12-29 22:53:19 +01:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
2024-04-19 00:30:06 +02:00
|
|
|
<div class="flex p-2">
|
|
|
|
<span class="material-icons-outlined text-5xl pt-1">audio_file</span>
|
2021-11-14 02:17:33 +01:00
|
|
|
<div class="px-1">
|
2024-04-19 00:30:06 +02:00
|
|
|
<p class="text-4.5xl leading-none font-bold">{{ $formatNumber(numAudioTracks) }}</p>
|
2023-02-11 22:02:56 +01:00
|
|
|
<p class="text-xs md:text-sm text-white text-opacity-80">{{ $strings.LabelStatsAudioTracks }}</p>
|
2021-11-14 02:17:33 +01:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
|
|
export default {
|
|
|
|
props: {
|
2021-12-02 02:07:03 +01:00
|
|
|
libraryStats: {
|
|
|
|
type: Object,
|
|
|
|
default: () => {}
|
2021-11-14 02:17:33 +01:00
|
|
|
}
|
|
|
|
},
|
|
|
|
data() {
|
|
|
|
return {}
|
|
|
|
},
|
|
|
|
computed: {
|
2023-08-19 23:53:33 +02:00
|
|
|
currentLibraryMediaType() {
|
|
|
|
return this.$store.getters['libraries/getCurrentLibraryMediaType']
|
|
|
|
},
|
|
|
|
isBookLibrary() {
|
|
|
|
return this.currentLibraryMediaType === 'book'
|
|
|
|
},
|
2021-11-14 02:17:33 +01:00
|
|
|
user() {
|
|
|
|
return this.$store.state.user.user
|
|
|
|
},
|
2022-03-13 23:33:50 +01:00
|
|
|
totalItems() {
|
2023-08-19 23:53:33 +02:00
|
|
|
return this.libraryStats?.totalItems || 0
|
2021-12-02 02:07:03 +01:00
|
|
|
},
|
|
|
|
totalAuthors() {
|
2023-08-19 23:53:33 +02:00
|
|
|
return this.libraryStats?.totalAuthors || 0
|
2021-11-14 02:17:33 +01:00
|
|
|
},
|
2021-12-29 22:53:19 +01:00
|
|
|
numAudioTracks() {
|
2023-08-19 23:53:33 +02:00
|
|
|
return this.libraryStats?.numAudioTracks || 0
|
2021-11-14 02:17:33 +01:00
|
|
|
},
|
2022-03-13 23:33:50 +01:00
|
|
|
totalDuration() {
|
2023-08-19 23:53:33 +02:00
|
|
|
return this.libraryStats?.totalDuration || 0
|
2021-11-14 02:17:33 +01:00
|
|
|
},
|
2022-03-13 23:33:50 +01:00
|
|
|
totalHours() {
|
2022-04-21 01:43:39 +02:00
|
|
|
return Math.round(this.totalDuration / (60 * 60))
|
2021-11-14 02:17:33 +01:00
|
|
|
},
|
2021-12-29 22:53:19 +01:00
|
|
|
totalSizePretty() {
|
2023-08-19 23:53:33 +02:00
|
|
|
var totalSize = this.libraryStats?.totalSize || 0
|
2021-12-29 22:53:19 +01:00
|
|
|
return this.$bytesPretty(totalSize, 1)
|
|
|
|
},
|
|
|
|
totalSizeNum() {
|
|
|
|
return this.totalSizePretty.split(' ')[0]
|
|
|
|
},
|
|
|
|
totalSizeMod() {
|
|
|
|
return this.totalSizePretty.split(' ')[1]
|
2022-04-21 01:43:39 +02:00
|
|
|
},
|
|
|
|
useOverallHours() {
|
|
|
|
return this.totalHours < 10000
|
|
|
|
},
|
|
|
|
totalTime() {
|
|
|
|
if (this.useOverallHours) return this.totalHours
|
|
|
|
return Math.round(this.totalHours / 24)
|
2021-11-14 02:17:33 +01:00
|
|
|
}
|
|
|
|
},
|
|
|
|
methods: {},
|
|
|
|
mounted() {}
|
|
|
|
}
|
|
|
|
</script>
|