mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2026-05-28 14:21:34 +00:00
ShareController check ?t param is less than duration, revert frontend mounted usage of param
This commit is contained in:
parent
5a6b3d8e61
commit
928051744a
2 changed files with 4 additions and 5 deletions
|
|
@ -363,9 +363,8 @@ export default {
|
||||||
console.log('Loaded media item share', this.mediaItemShare)
|
console.log('Loaded media item share', this.mediaItemShare)
|
||||||
}
|
}
|
||||||
|
|
||||||
const startTime = this.$route.query.t && !isNaN(this.$route.query.t)
|
const startTime = this.playbackSession.currentTime || 0
|
||||||
? parseFloat(this.$route.query.t)
|
|
||||||
: (this.playbackSession.currentTime || 0)
|
|
||||||
this.localAudioPlayer.set(null, this.audioTracks, false, startTime, false)
|
this.localAudioPlayer.set(null, this.audioTracks, false, startTime, false)
|
||||||
this.localAudioPlayer.on('stateChange', this.playerStateChange.bind(this))
|
this.localAudioPlayer.on('stateChange', this.playerStateChange.bind(this))
|
||||||
this.localAudioPlayer.on('timeupdate', this.playerTimeUpdate.bind(this))
|
this.localAudioPlayer.on('timeupdate', this.playerTimeUpdate.bind(this))
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,7 @@ const ShareManager = require('../managers/ShareManager')
|
||||||
*/
|
*/
|
||||||
|
|
||||||
class ShareController {
|
class ShareController {
|
||||||
constructor() { }
|
constructor() {}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Public route
|
* Public route
|
||||||
|
|
@ -54,7 +54,7 @@ class ShareController {
|
||||||
if (mediaItemShare.id === playbackSession.mediaItemShareId) {
|
if (mediaItemShare.id === playbackSession.mediaItemShareId) {
|
||||||
Logger.debug(`[ShareController] Found share playback session ${req.cookies.share_session_id}`)
|
Logger.debug(`[ShareController] Found share playback session ${req.cookies.share_session_id}`)
|
||||||
// If ?t was provided, override the cached currentTime
|
// If ?t was provided, override the cached currentTime
|
||||||
if (startTime > 0) {
|
if (startTime > 0 && startTime < playbackSession.duration) {
|
||||||
playbackSession.currentTime = startTime
|
playbackSession.currentTime = startTime
|
||||||
}
|
}
|
||||||
mediaItemShare.playbackSession = playbackSession.toJSONForClient()
|
mediaItemShare.playbackSession = playbackSession.toJSONForClient()
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue