2021-08-21 16:23:35 -05:00
|
|
|
<template>
|
2022-01-04 07:36:52 -06:00
|
|
|
<div class="flex items-center h-full px-1 overflow-hidden">
|
2022-03-13 12:39:12 -05:00
|
|
|
<covers-book-cover :library-item="libraryItem" :width="coverWidth" :book-cover-aspect-ratio="bookCoverAspectRatio" />
|
2021-10-17 11:29:52 -05:00
|
|
|
<div class="flex-grow px-2 audiobookSearchCardContent">
|
2024-07-25 09:40:18 +03:00
|
|
|
<p class="truncate text-sm">{{ title }}</p>
|
|
|
|
<p v-if="subtitle" class="truncate text-xs text-gray-300">{{ subtitle }}</p>
|
|
|
|
<p class="text-xs text-gray-200 truncate">{{ $getString('LabelByAuthor', [authorName]) }}</p>
|
2021-08-21 16:23:35 -05:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
|
|
export default {
|
|
|
|
props: {
|
2022-03-13 12:39:12 -05:00
|
|
|
libraryItem: {
|
2021-08-21 16:23:35 -05:00
|
|
|
type: Object,
|
|
|
|
default: () => {}
|
2024-07-25 09:40:18 +03:00
|
|
|
}
|
2021-08-21 16:23:35 -05:00
|
|
|
},
|
|
|
|
data() {
|
|
|
|
return {}
|
|
|
|
},
|
|
|
|
computed: {
|
2021-12-02 19:02:38 -06:00
|
|
|
bookCoverAspectRatio() {
|
2022-08-13 13:56:37 -05:00
|
|
|
return this.$store.getters['libraries/getBookCoverAspectRatio']
|
2021-12-02 19:02:38 -06:00
|
|
|
},
|
|
|
|
coverWidth() {
|
|
|
|
if (this.bookCoverAspectRatio === 1) return 50 * 1.2
|
|
|
|
return 50
|
|
|
|
},
|
2022-03-13 12:39:12 -05:00
|
|
|
media() {
|
|
|
|
return this.libraryItem ? this.libraryItem.media || {} : {}
|
|
|
|
},
|
2022-04-12 16:54:52 -05:00
|
|
|
mediaType() {
|
|
|
|
return this.libraryItem ? this.libraryItem.mediaType : null
|
|
|
|
},
|
|
|
|
isPodcast() {
|
|
|
|
return this.mediaType == 'podcast'
|
|
|
|
},
|
2022-03-13 12:39:12 -05:00
|
|
|
mediaMetadata() {
|
|
|
|
return this.media.metadata || {}
|
2021-08-21 16:23:35 -05:00
|
|
|
},
|
|
|
|
title() {
|
2022-03-13 12:39:12 -05:00
|
|
|
return this.mediaMetadata.title || 'No Title'
|
2021-08-21 16:23:35 -05:00
|
|
|
},
|
2021-10-17 11:29:52 -05:00
|
|
|
subtitle() {
|
2022-03-13 12:39:12 -05:00
|
|
|
return this.mediaMetadata.subtitle || ''
|
|
|
|
},
|
|
|
|
authorName() {
|
2022-04-12 16:54:52 -05:00
|
|
|
if (this.isPodcast) return this.mediaMetadata.author || 'Unknown'
|
|
|
|
return this.mediaMetadata.authorName || 'Unknown'
|
2021-08-21 16:23:35 -05:00
|
|
|
}
|
|
|
|
},
|
|
|
|
methods: {},
|
|
|
|
mounted() {}
|
|
|
|
}
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<style>
|
2021-10-17 11:29:52 -05:00
|
|
|
.audiobookSearchCardContent {
|
2021-08-21 16:23:35 -05:00
|
|
|
width: calc(100% - 80px);
|
2021-10-17 11:29:52 -05:00
|
|
|
height: 75px;
|
2021-08-21 16:23:35 -05:00
|
|
|
display: flex;
|
|
|
|
flex-direction: column;
|
|
|
|
justify-content: center;
|
|
|
|
}
|
2024-05-13 17:25:01 -05:00
|
|
|
</style>
|