feat: Add native podcast episode bookmarking#5173
Open
johneliott wants to merge 1 commit intoadvplyr:masterfrom
Open
feat: Add native podcast episode bookmarking#5173johneliott wants to merge 1 commit intoadvplyr:masterfrom
johneliott wants to merge 1 commit intoadvplyr:masterfrom
Conversation
Contributor
|
I have not read through the PR code yet, but we are not reviewing AI generated PRs at this time due to an increasing number of low-quality AI PRs. Someone else may take a look at it but I am not planning to review it at this time. |
Author
|
@nichwall don't fret, this was entirely my effort. |
Contributor
The PR description looks like a verbatim copy paste from an AI agent or chat, so that doesn't inspire confidence when first looking at a PR. I'll try and take a look at the code later, but it'll probably be a few days before I can. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Resolves #884
Changes
1. Backend Database Model (
server/models/User.js)createBookmark,updateBookmark,removeBookmark, andfindBookmarkmethods to accept an optionalepisodeIdparameter.episodeIdto the JSON payload for new podcast bookmarks while seamlessly falling back to standardlibraryItemIdbehavior for audiobooks (or legacy data).2. Backend API Endpoints (
server/controllers/MeController.js)POST /api/me/item/:id/bookmarkandPATCH /api/me/item/:id/bookmarkto parseepisodeIddirectly from thereq.body.DELETE /api/me/item/:id/bookmark/:timeto accept anepisodeIdvia a query parameter (req.query.episode).3. Frontend Vuex Store (
client/store/user.js)getUserBookmarksForItemto take an optionalepisodeId. If provided, it filters out all bookmarks that belong to different episodes, ensuring you only see the bookmarks for the episode you are currently listening to.4. Frontend UI Components (
client/components/...)PlayerUi.vue: Removed the!isPodcastblock that artificially hid the bookmark icon when playing a podcast.MediaPlayerContainer.vue: Passed the active$store.state.streamEpisodeIddown into the computedbookmarks()list and into the<modals-bookmarks-modal>prop.BookmarksModal.vue: Added theepisodeIdprop. When creating a new bookmark, it injects theepisodeIdinto thePOSTbody. When deleting, it intelligently appends?episode=${this.episodeId}to theDELETEURL.Automated Test Plan: Podcast Episode Bookmarks
Prerequisites
http://localhost:13380).<AUTH_TOKEN>).bc57c7f0-08dc-4b7e-b570-2268dd7d6cc2).09690803-ae60-4b25-8f7d-f2bcccd6bb83).Step 1: Create a Bookmark
Command:
Response:
{ "libraryItemId": "bc57c7f0-08dc-4b7e-b570-2268dd7d6cc2", "time": 420, "title": "Ziva Cooper talking about THC receptors", "createdAt": 1775677075715, "episodeId": "09690803-ae60-4b25-8f7d-f2bcccd6bb83" }Step 2: Verify the Bookmark (Read)
Command:
Response:
{ "libraryItemId": "bc57c7f0-08dc-4b7e-b570-2268dd7d6cc2", "time": 420, "title": "Ziva Cooper talking about THC receptors", "createdAt": 1775677075715, "episodeId": "09690803-ae60-4b25-8f7d-f2bcccd6bb83" }Step 3: Update the Bookmark
Command:
Response:
{ "libraryItemId": "bc57c7f0-08dc-4b7e-b570-2268dd7d6cc2", "time": 420, "title": "UPDATED: Ziva Cooper on THC vs CBD receptors", "createdAt": 1775677075715, "episodeId": "09690803-ae60-4b25-8f7d-f2bcccd6bb83" }Step 4: Delete the Bookmark
Command:
Response:
Step 5: Validate Error & Warning Logging
This step ensures that the server correctly validates input and logs issues as expected.
5.1 Trigger "Invalid Time" Error
curl -s -X POST -H "Authorization: Bearer <AUTH_TOKEN>" -H "Content-Type: application/json" -d '{"title": "Missing Time"}' http://localhost:13380/api/me/item/bc57c7f0-08dc-4b7e-b570-2268dd7d6cc2/bookmarkERROR: [MeController] createBookmark invalid time undefined5.2 Trigger "Invalid Title" Error
curl -s -X POST -H "Authorization: Bearer <AUTH_TOKEN>" -H "Content-Type: application/json" -d '{"time": 123}' http://localhost:13380/api/me/item/bc57c7f0-08dc-4b7e-b570-2268dd7d6cc2/bookmarkERROR: [MeController] createBookmark invalid title undefined5.3 Trigger "Already Exists" Warning
curl -s -X POST ...(Duplicate attempt)WARN: [User] Create Bookmark already exists for this time5.4 Trigger "Update Not Found" Error
curl -s -X PATCH ...(Time 9999)ERROR: [User] updateBookmark not found5.5 Trigger "Remove Not Found" Error
curl -s -X DELETE ...(Time 9999)ERROR: [MeController] removeBookmark not foundManual UI Verification Plan
1. Preparation
Ensure the Audiobookshelf server is running and you are logged in to the web interface.
2. Verify UI Visibility
3. Test Bookmark Creation
4. Test Episode Isolation (The Core Fix)
This verifies that bookmarks are now tied to specific episodes rather than the whole podcast series:
5. Test Deletion