mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2026-05-13 06:51:29 +00:00
updates to allow share t argument to over-ride server stored position
This commit is contained in:
parent
64cbf59609
commit
5a6b3d8e61
2 changed files with 8 additions and 2 deletions
|
|
@ -20,7 +20,7 @@ const ShareManager = require('../managers/ShareManager')
|
|||
*/
|
||||
|
||||
class ShareController {
|
||||
constructor() {}
|
||||
constructor() { }
|
||||
|
||||
/**
|
||||
* Public route
|
||||
|
|
@ -53,6 +53,10 @@ class ShareController {
|
|||
if (playbackSession) {
|
||||
if (mediaItemShare.id === playbackSession.mediaItemShareId) {
|
||||
Logger.debug(`[ShareController] Found share playback session ${req.cookies.share_session_id}`)
|
||||
// If ?t was provided, override the cached currentTime
|
||||
if (startTime > 0) {
|
||||
playbackSession.currentTime = startTime
|
||||
}
|
||||
mediaItemShare.playbackSession = playbackSession.toJSONForClient()
|
||||
return res.json(mediaItemShare)
|
||||
} else {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue