diff --git a/assets/app.css b/assets/app.css index c9e64e55..a7a06d1a 100644 --- a/assets/app.css +++ b/assets/app.css @@ -102,4 +102,11 @@ Bookshelf Label background-position: center; opacity: 1; filter: blur(20px); +} + +.line-clamp-2 { + overflow: hidden; + display: -webkit-box; + -webkit-box-orient: vertical; + -webkit-line-clamp: 2; } \ No newline at end of file diff --git a/components/cards/LazyBookCard.vue b/components/cards/LazyBookCard.vue index e6b6176f..0ff4f236 100644 --- a/components/cards/LazyBookCard.vue +++ b/components/cards/LazyBookCard.vue @@ -35,7 +35,7 @@ -
+
{{ streamIsPlaying ? 'pause_circle' : 'play_circle_filled' }}
@@ -401,38 +401,40 @@ export default { // Server books may have a local library item this.localLibraryItem = localLibraryItem }, + async playEpisode() { + await this.$hapticsImpact() + const eventBus = this.$eventBus || this.$nuxt.$eventBus + if (this.streamIsPlaying) { + eventBus.$emit('pause-item') + return + } + + if (this.localLibraryItem) { + const localEpisode = this.localLibraryItem.media.episodes.find((ep) => ep.serverEpisodeId === this.recentEpisode.id) + if (localEpisode) { + // Play episode locally + eventBus.$emit('play-item', { + libraryItemId: this.localLibraryItemId, + episodeId: localEpisode.id, + serverLibraryItemId: this.libraryItemId, + serverEpisodeId: this.recentEpisode.id + }) + return + } + } + + eventBus.$emit('play-item', { libraryItemId: this.libraryItemId, episodeId: this.recentEpisode.id }) + }, async clickCard(e) { if (this.isSelectionMode) { e.stopPropagation() e.preventDefault() this.selectBtnClick() - } else if (this.recentEpisode) { - await this.$hapticsImpact() - var eventBus = this.$eventBus || this.$nuxt.$eventBus - if (this.streamIsPlaying) { - eventBus.$emit('pause-item') - return - } - - if (this.localLibraryItem) { - const localEpisode = this.localLibraryItem.media.episodes.find((ep) => ep.serverEpisodeId === this.recentEpisode.id) - if (localEpisode) { - // Play episode locally - eventBus.$emit('play-item', { - libraryItemId: this.localLibraryItemId, - episodeId: localEpisode.id, - serverLibraryItemId: this.libraryItemId, - serverEpisodeId: this.recentEpisode.id - }) - return - } - } - - eventBus.$emit('play-item', { libraryItemId: this.libraryItemId, episodeId: this.recentEpisode.id }) } else { - var router = this.$router || this.$nuxt.$router + const router = this.$router || this.$nuxt.$router if (router) { - if (this.collapsedSeries) router.push(`/library/${this.libraryId}/series/${this.collapsedSeries.id}`) + if (this.recentEpisode) router.push(`/item/${this.libraryItemId}/${this.recentEpisode.id}`) + else if (this.collapsedSeries) router.push(`/library/${this.libraryId}/series/${this.collapsedSeries.id}`) else router.push(`/item/${this.libraryItemId}`) } } diff --git a/components/tables/podcast/EpisodeRow.vue b/components/tables/podcast/EpisodeRow.vue index 1d7ea556..b9dd9894 100644 --- a/components/tables/podcast/EpisodeRow.vue +++ b/components/tables/podcast/EpisodeRow.vue @@ -1,5 +1,5 @@ + + \ No newline at end of file diff --git a/pages/item/_id/index.vue b/pages/item/_id/index.vue index 9699d1c8..a8d49576 100644 --- a/pages/item/_id/index.vue +++ b/pages/item/_id/index.vue @@ -127,7 +127,7 @@
-

{{ description }}

+

{{ description }}

@@ -150,9 +150,8 @@ import { FastAverageColor } from 'fast-average-color' export default { async asyncData({ store, params, redirect, app }) { - var libraryItemId = params.id - var libraryItem = null - console.log(libraryItemId) + const libraryItemId = params.id + let libraryItem = null if (libraryItemId.startsWith('local')) { libraryItem = await app.$db.getLocalLibraryItem(libraryItemId) console.log('Got lli', libraryItemId) @@ -161,9 +160,9 @@ export default { console.error('Failed', error) return false }) - // Check if + if (libraryItem) { - var localLibraryItem = await app.$db.getLocalLibraryItemByLId(libraryItemId) + const localLibraryItem = await app.$db.getLocalLibraryItemByLId(libraryItemId) if (localLibraryItem) { console.log('Library item has local library item also', localLibraryItem.id) libraryItem.localLibraryItem = localLibraryItem @@ -314,9 +313,6 @@ export default { progressPercent() { return this.userItemProgress ? Math.max(Math.min(1, this.userItemProgress.progress), 0) : 0 }, - userProgressStartedAt() { - return this.userItemProgress ? this.userItemProgress.startedAt : 0 - }, userProgressFinishedAt() { return this.userItemProgress ? this.userItemProgress.finishedAt : 0 },