mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2026-05-18 09:21:31 +00:00
Merge branch 'advplyr:master' into add-i18n-japanese
This commit is contained in:
commit
63de5bb2d5
3 changed files with 11 additions and 1 deletions
|
|
@ -364,6 +364,7 @@ export default {
|
||||||
}
|
}
|
||||||
|
|
||||||
const startTime = this.playbackSession.currentTime || 0
|
const startTime = 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))
|
||||||
|
|
|
||||||
|
|
@ -53,6 +53,10 @@ class ShareController {
|
||||||
if (playbackSession) {
|
if (playbackSession) {
|
||||||
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 (startTime > 0 && startTime < playbackSession.duration) {
|
||||||
|
playbackSession.currentTime = startTime
|
||||||
|
}
|
||||||
mediaItemShare.playbackSession = playbackSession.toJSONForClient()
|
mediaItemShare.playbackSession = playbackSession.toJSONForClient()
|
||||||
return res.json(mediaItemShare)
|
return res.json(mediaItemShare)
|
||||||
} else {
|
} else {
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,5 @@
|
||||||
const axios = require('axios')
|
const axios = require('axios')
|
||||||
|
const ssrfFilter = require('ssrf-req-filter')
|
||||||
const Ffmpeg = require('../libs/fluentFfmpeg')
|
const Ffmpeg = require('../libs/fluentFfmpeg')
|
||||||
const ffmpgegUtils = require('../libs/fluentFfmpeg/utils')
|
const ffmpgegUtils = require('../libs/fluentFfmpeg/utils')
|
||||||
const fs = require('../libs/fsExtra')
|
const fs = require('../libs/fsExtra')
|
||||||
|
|
@ -97,6 +98,8 @@ async function resizeImage(filePath, outputPath, width, height) {
|
||||||
module.exports.resizeImage = resizeImage
|
module.exports.resizeImage = resizeImage
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* Download podcast episode
|
||||||
|
* Uses SSRF filter to prevent internal URLs
|
||||||
*
|
*
|
||||||
* @param {import('../objects/PodcastEpisodeDownload')} podcastEpisodeDownload
|
* @param {import('../objects/PodcastEpisodeDownload')} podcastEpisodeDownload
|
||||||
* @returns {Promise<{success: boolean, isRequestError?: boolean}>}
|
* @returns {Promise<{success: boolean, isRequestError?: boolean}>}
|
||||||
|
|
@ -121,7 +124,9 @@ module.exports.downloadPodcastEpisode = (podcastEpisodeDownload) => {
|
||||||
Accept: '*/*',
|
Accept: '*/*',
|
||||||
'User-Agent': userAgent
|
'User-Agent': userAgent
|
||||||
},
|
},
|
||||||
timeout: global.PodcastDownloadTimeout
|
timeout: global.PodcastDownloadTimeout,
|
||||||
|
httpAgent: global.DisableSsrfRequestFilter?.(podcastEpisodeDownload.url) ? null : ssrfFilter(podcastEpisodeDownload.url),
|
||||||
|
httpsAgent: global.DisableSsrfRequestFilter?.(podcastEpisodeDownload.url) ? null : ssrfFilter(podcastEpisodeDownload.url)
|
||||||
})
|
})
|
||||||
|
|
||||||
Logger.debug(`[ffmpegHelpers] Successfully connected with User-Agent: ${userAgent}`)
|
Logger.debug(`[ffmpegHelpers] Successfully connected with User-Agent: ${userAgent}`)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue