mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2025-07-31 16:24:45 +02:00
feat: Add a Show Subtitles option
This commit is contained in:
parent
5f8066e601
commit
3ef189ed4a
5 changed files with 33 additions and 0 deletions
|
@ -127,6 +127,9 @@
|
|||
<widgets-explicit-indicator cy-id="explicitIndicator" v-if="isExplicit" />
|
||||
</ui-tooltip>
|
||||
</div>
|
||||
<ui-tooltip v-if="showSubtitles" :text="displayLineOne" :disabled="!displayLineOneTruncated" direction="bottom" :delayOnShow="500" class="flex items-center">
|
||||
<p class="truncate" ref="displayLineOne" :style="{ fontSize: 0.6 + 'em' }">{{ displayLineOne }}</p>
|
||||
</ui-tooltip>
|
||||
<p cy-id="line2" class="truncate text-gray-400" :style="{ fontSize: 0.8 + 'em' }">{{ displayLineTwo || ' ' }}</p>
|
||||
<p cy-id="line3" v-if="displaySortLine" class="truncate text-gray-400" :style="{ fontSize: 0.8 + 'em' }">{{ displaySortLine }}</p>
|
||||
</div>
|
||||
|
@ -166,6 +169,7 @@ export default {
|
|||
selected: false,
|
||||
isSelectionMode: false,
|
||||
displayTitleTruncated: false,
|
||||
displayLineOneTruncated: false,
|
||||
showCoverBg: false
|
||||
}
|
||||
},
|
||||
|
@ -334,6 +338,13 @@ export default {
|
|||
if (this.collapsedSeries) return ignorePrefix ? this.collapsedSeries.nameIgnorePrefix : this.collapsedSeries.name
|
||||
return ignorePrefix ? this.mediaMetadata.titleIgnorePrefix : this.title || '\u00A0'
|
||||
},
|
||||
displayLineOne() {
|
||||
if (this.collapsedSeries) return this.collapsedSeries.numBooks === 1 ? '1 book' : `${this.collapsedSeries.numBooks} books`
|
||||
if (this.mediaMetadata.subtitle) return this.mediaMetadata.subtitle
|
||||
if (this.mediaMetadata.seriesName) return this.mediaMetadata.seriesName
|
||||
if (this.mediaMetadata.genres) return this.mediaMetadata.genres.filter((genre) => !['Podcasts', 'Audiobook'].includes(genre)).join(', ') || '\u00A0'
|
||||
return '\u00A0'
|
||||
},
|
||||
displayLineTwo() {
|
||||
if (this.recentEpisode) return this.title
|
||||
if (this.isPodcast) return this.author
|
||||
|
@ -627,6 +638,9 @@ export default {
|
|||
rssFeed() {
|
||||
if (this.booksInSeries) return null
|
||||
return this._libraryItem.rssFeed || null
|
||||
},
|
||||
showSubtitles() {
|
||||
return this.store.getters['user/getUserSetting']('showSubtitles')
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
|
@ -668,6 +682,9 @@ export default {
|
|||
if (this.$refs.displayTitle) {
|
||||
this.displayTitleTruncated = this.$refs.displayTitle.scrollWidth > this.$refs.displayTitle.clientWidth
|
||||
}
|
||||
if (this.$refs.displayLineOne) {
|
||||
this.displayLineOneTruncated = this.$refs.displayLineOne.scrollWidth > this.$refs.displayLineOne.clientWidth
|
||||
}
|
||||
})
|
||||
},
|
||||
clickCard(e) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue