[PR #5104] Per-book playback speed #4427

Open
opened 2026-04-25 00:19:42 +02:00 by adam · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/advplyr/audiobookshelf/pull/5104
Author: @octopotato
Created: 3/5/2026
Status: 🔄 Open

Base: masterHead: feat/per-book-playback-rate


📝 Commits (4)

  • 8bd99a4 Add playbackRate to MediaProgress extraData for per-book playback speed #1173
  • df2db63 Add per-book playback rate to web client #1173
  • 820ad88 Fix keyboard playback rate shortcuts not persisting
  • 212734a Add MediaProgress playbackRate unit tests

📊 Changes

4 files changed (+145 additions, -6 deletions)

View changed files

📝 client/components/app/MediaPlayerContainer.vue (+5 -1)
📝 client/components/player/PlayerUi.vue (+32 -5)
📝 server/models/MediaProgress.js (+6 -0)
test/server/models/MediaProgress.test.js (+102 -0)

📄 Description

Brief summary

Saves playback speed per book/episode so each title remembers its own narration speed. Also fixes keyboard shortcuts (Shift+Arrow) not persisting playback rate at all.

Which issue is fixed?

In-depth Description

Stores playback rate per item in mediaProgress.extraData.playbackRate. When a book/episode is opened, it checks for a saved per-item rate and falls back to the global user setting if there isn't one.

No migration needed — playbackRate is just a new optional key in the existing extraData JSON column. Nothing changes for existing users until they start setting per-item speeds.

The keyboard shortcut fix is separate but related — increasePlaybackRate/decreasePlaybackRate bypassed playbackRateChanged, so they never persisted at all (pre-existing bug).

Note

This does not add a dedicated setting in the player settings for changing the "global default speed." The last speed change on any item is treated as the new global default for items without a per-item rate. A dedicated global rate dropdown in the player settings modal would be a nice follow-up but I kept it out of this PR to keep the change contained.

How have you tested this?

  • Set different speeds on two books, switched between them — each keeps its own rate
  • Hard refreshed — rates persist from the database
  • Played a book with no saved rate — falls back to global setting correctly
  • Tested Shift+ArrowUp/Down — rate now saves
  • Tested with podcast episodes (Planet Money) — per-episode speed persists correctly
  • Full test suite passes (324 tests including 9 new MediaProgress model tests)

Screenshots

https://github.com/user-attachments/assets/c1087a79-e24d-40d9-9e6f-e7ba7c4fcd0b


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/advplyr/audiobookshelf/pull/5104 **Author:** [@octopotato](https://github.com/octopotato) **Created:** 3/5/2026 **Status:** 🔄 Open **Base:** `master` ← **Head:** `feat/per-book-playback-rate` --- ### 📝 Commits (4) - [`8bd99a4`](https://github.com/advplyr/audiobookshelf/commit/8bd99a459ed50a5426e87a23c4e856865ee9cad2) Add playbackRate to MediaProgress extraData for per-book playback speed #1173 - [`df2db63`](https://github.com/advplyr/audiobookshelf/commit/df2db634a72ef6429f00fbcedf5f4d07cf0fa015) Add per-book playback rate to web client #1173 - [`820ad88`](https://github.com/advplyr/audiobookshelf/commit/820ad889951b031e592537a133370338528bf943) Fix keyboard playback rate shortcuts not persisting - [`212734a`](https://github.com/advplyr/audiobookshelf/commit/212734a92f79d0ec0ccbd82a06232df363e90892) Add MediaProgress playbackRate unit tests ### 📊 Changes **4 files changed** (+145 additions, -6 deletions) <details> <summary>View changed files</summary> 📝 `client/components/app/MediaPlayerContainer.vue` (+5 -1) 📝 `client/components/player/PlayerUi.vue` (+32 -5) 📝 `server/models/MediaProgress.js` (+6 -0) ➕ `test/server/models/MediaProgress.test.js` (+102 -0) </details> ### 📄 Description ## Brief summary Saves playback speed per book/episode so each title remembers its own narration speed. Also fixes keyboard shortcuts (`Shift+Arrow`) not persisting playback rate at all. ## Which issue is fixed? - Fixes #1173 ## In-depth Description Stores playback rate per item in `mediaProgress.extraData.playbackRate`. When a book/episode is opened, it checks for a saved per-item rate and falls back to the global user setting if there isn't one. No migration needed — `playbackRate` is just a new optional key in the existing `extraData` JSON column. Nothing changes for existing users until they start setting per-item speeds. The keyboard shortcut fix is separate but related — `increasePlaybackRate`/`decreasePlaybackRate` bypassed `playbackRateChanged`, so they never persisted at all (pre-existing bug). > [!NOTE] > This does not add a dedicated setting in the player settings for changing the "global default speed." The last speed change on any item is treated as the new global default for items without a per-item rate. A dedicated global rate dropdown in the player settings modal would be a nice follow-up but I kept it out of this PR to keep the change contained. ## How have you tested this? - Set different speeds on two books, switched between them — each keeps its own rate - Hard refreshed — rates persist from the database - Played a book with no saved rate — falls back to global setting correctly - Tested Shift+ArrowUp/Down — rate now saves - Tested with podcast episodes (Planet Money) — per-episode speed persists correctly - Full test suite passes (324 tests including 9 new MediaProgress model tests) ## Screenshots https://github.com/user-attachments/assets/c1087a79-e24d-40d9-9e6f-e7ba7c4fcd0b --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
adam added the pull-request label 2026-04-25 00:19:42 +02:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/audiobookshelf#4427