feat: Add native podcast episode bookmarking

This commit is contained in:
john eliot 2026-04-08 12:48:12 -07:00
parent 8b89b27654
commit ca6c7d7958
7 changed files with 54 additions and 29 deletions

View file

@ -55,7 +55,7 @@
@showPlayerQueueItems="showPlayerQueueItemsModal = true"
/>
<modals-bookmarks-modal v-model="showBookmarksModal" :bookmarks="bookmarks" :current-time="bookmarkCurrentTime" :playback-rate="currentPlaybackRate" :library-item-id="libraryItemId" @select="selectBookmark" />
<modals-bookmarks-modal v-model="showBookmarksModal" :bookmarks="bookmarks" :current-time="bookmarkCurrentTime" :playback-rate="currentPlaybackRate" :library-item-id="libraryItemId" :episode-id="$store.state.streamEpisodeId" @select="selectBookmark" />
<modals-sleep-timer-modal v-model="showSleepTimerModal" :timer-set="sleepTimerSet" :timer-type="sleepTimerType" :remaining="sleepTimerRemaining" :has-chapters="!!chapters.length" @set="setSleepTimer" @cancel="cancelSleepTimer" @increment="incrementSleepTimer" @decrement="decrementSleepTimer" />
@ -116,7 +116,7 @@ export default {
},
bookmarks() {
if (!this.libraryItemId) return []
return this.$store.getters['user/getUserBookmarksForItem'](this.libraryItemId)
return this.$store.getters['user/getUserBookmarksForItem'](this.libraryItemId, this.$store.state.streamEpisodeId)
},
streamLibraryItem() {
return this.$store.state.streamLibraryItem

View file

@ -47,6 +47,7 @@ export default {
default: 0
},
libraryItemId: String,
episodeId: String,
playbackRate: Number,
hideCreate: Boolean
},
@ -92,8 +93,9 @@ export default {
this.showBookmarkTitleInput = true
},
deleteBookmark(bm) {
const deleteUrl = this.episodeId ? `/api/me/item/${this.libraryItemId}/bookmark/${bm.time}?episode=${this.episodeId}` : `/api/me/item/${this.libraryItemId}/bookmark/${bm.time}`
this.$axios
.$delete(`/api/me/item/${this.libraryItemId}/bookmark/${bm.time}`)
.$delete(deleteUrl)
.then(() => {
this.$toast.success(this.$strings.ToastBookmarkRemoveSuccess)
})
@ -114,6 +116,7 @@ export default {
title: this.newBookmarkTitle,
time: Math.floor(this.currentTime)
}
if (this.episodeId) bookmark.episodeId = this.episodeId
this.$axios
.$post(`/api/me/item/${this.libraryItemId}/bookmark`, bookmark)
.then(() => {

View file

@ -18,7 +18,7 @@
</button>
</ui-tooltip>
<ui-tooltip v-if="!isPodcast && !hideBookmarks" direction="top" :text="$strings.LabelViewBookmarks">
<ui-tooltip v-if="!hideBookmarks" direction="top" :text="$strings.LabelViewBookmarks">
<button :aria-label="$strings.LabelViewBookmarks" class="text-gray-300 hover:text-white mx-1 lg:mx-2" @mousedown.prevent @mouseup.prevent @click.stop="$emit('showBookmarks')">
<span class="material-symbols text-2xl">{{ bookmarks.length ? 'bookmarks' : 'bookmark_border' }}</span>
</button>