[Enhancement]: Smart rewind #1130

Closed
opened 2026-04-24 23:49:29 +02:00 by adam · 3 comments
Owner

Originally created by @pickles4evaaaa on GitHub (Jan 22, 2025).

Describe the Feature/Enhancement

I see that the Android app has this feature but iOS does not.

Basically: If you pause your book for more than 10 minutes and then resume play, the playback will rewind 10-30 seconds.

Why would this be helpful?

The listener is able to get a quick recap of where they are at in the book after they have been paused for more than 10 minutes.

Future Implementation (Screenshot)

The app "Bound" on iOS has this feature

Audiobookshelf App Version

iOS App - 0.9.78

Current Implementation (Screenshot)

No response

Originally created by @pickles4evaaaa on GitHub (Jan 22, 2025). ### Describe the Feature/Enhancement I see that the Android app has this feature but iOS does not. Basically: If you pause your book for more than 10 minutes and then resume play, the playback will rewind 10-30 seconds. ### Why would this be helpful? The listener is able to get a quick recap of where they are at in the book after they have been paused for more than 10 minutes. ### Future Implementation (Screenshot) The app "Bound" on iOS has this feature ### Audiobookshelf App Version iOS App - 0.9.78 ### Current Implementation (Screenshot) _No response_
adam added the enhancement label 2026-04-24 23:49:29 +02:00
adam closed this issue 2026-04-24 23:49:30 +02:00
Author
Owner

@complacentsee commented on GitHub (Mar 10, 2025):

The code for this functionality is largely implemented on iOS and has been in place for some time. However, a bug has been identified in the function.

Description

  • Location: The bug is in the PlayerTimeUtils.swift file.
  • Issue: The function timeSinceLastPlayed returns a negative time interval, but the related function timeToSeekBackForSinceLastPlayed expects a positive number.

Original Code

static internal func timeSinceLastPlayed(_ lastPlayedMs: Double?) -> TimeInterval? {
    guard let lastPlayedMs = lastPlayedMs else { return nil }
    let lastPlayed = Date(timeIntervalSince1970: lastPlayedMs / 1000)
    return DatelastPlayed.timeIntervalSinceNow
}

Corrected Code

static internal func timeSinceLastPlayed(_ lastPlayedMs: Double?) -> TimeInterval? {
    guard let lastPlayedMs = lastPlayedMs else { return nil }
    let lastPlayed = Date(timeIntervalSince1970: lastPlayedMs / 1000)
    // Return a positive elapsed time.
    return Date().timeIntervalSince(lastPlayed)
}

Lastly the code for disabling the feature is mostly completed, but the setting isn't enabled in the iOS GUI build, and the settings variable isn't use.

Not sure if there is more history to this. But I'll submit a PR soon.

I'll submit a PR for this

@complacentsee commented on GitHub (Mar 10, 2025): The code for this functionality is largely implemented on iOS and has been in place for some time. However, a bug has been identified in the function. ## Description - **Location:** The bug is in the [PlayerTimeUtils.swift](https://github.com/advplyr/audiobookshelf-app/blob/master/ios/App/Shared/player/util/PlayerTimeUtils.swift) file. - **Issue:** The function `timeSinceLastPlayed` returns a negative time interval, but the related function `timeToSeekBackForSinceLastPlayed` expects a positive number. ## Original Code ```swift static internal func timeSinceLastPlayed(_ lastPlayedMs: Double?) -> TimeInterval? { guard let lastPlayedMs = lastPlayedMs else { return nil } let lastPlayed = Date(timeIntervalSince1970: lastPlayedMs / 1000) return DatelastPlayed.timeIntervalSinceNow } ``` ## Corrected Code ```swift static internal func timeSinceLastPlayed(_ lastPlayedMs: Double?) -> TimeInterval? { guard let lastPlayedMs = lastPlayedMs else { return nil } let lastPlayed = Date(timeIntervalSince1970: lastPlayedMs / 1000) // Return a positive elapsed time. return Date().timeIntervalSince(lastPlayed) } ``` Lastly the code for disabling the feature is mostly completed, but the setting isn't enabled in the iOS GUI build, and the settings variable isn't use. Not sure if there is more history to this. But I'll submit a PR soon. I'll submit a PR for this
Author
Owner

@pickles4evaaaa commented on GitHub (Mar 10, 2025):

@complacentsee This is so exciting! Thanks :)

@pickles4evaaaa commented on GitHub (Mar 10, 2025): @complacentsee This is so exciting! Thanks :)
Author
Owner

@github-actions[bot] commented on GitHub (Apr 21, 2025):

Fixed in v0.9.80-beta.

@github-actions[bot] commented on GitHub (Apr 21, 2025): Fixed in [v0.9.80-beta](https://github.com/advplyr/audiobookshelf-app/releases/tag/v0.9.80-beta).
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/audiobookshelf-app#1130