1
0
mirror of https://git.sr.ht/~cadence/cloudtube synced 2024-11-22 15:47:30 +00:00

Fix media fragments in local mode

This commit is contained in:
Cadence Ember 2021-02-03 21:04:48 +13:00
parent d50e07f053
commit ebdc88fe4c
No known key found for this signature in database
GPG Key ID: BC1C2C61CF521B17

View File

@ -123,9 +123,9 @@ module.exports = [
const user = getUser(req) const user = getUser(req)
const settings = user.getSettingsOrDefaults() const settings = user.getSettingsOrDefaults()
const id = url.searchParams.get("v") const id = url.searchParams.get("v")
if (req.method === "GET") {
const t = url.searchParams.get("t") const t = url.searchParams.get("t")
let mediaFragment = converters.tToMediaFragment(t) let mediaFragment = converters.tToMediaFragment(t)
if (req.method === "GET") {
if (!settings.local) { if (!settings.local) {
const instanceOrigin = settings.instance const instanceOrigin = settings.instance
const outURL = `${instanceOrigin}/api/v1/videos/${id}` const outURL = `${instanceOrigin}/api/v1/videos/${id}`
@ -138,7 +138,7 @@ module.exports = [
const video = JSON.parse(new URLSearchParams(body.toString()).get("video")) const video = JSON.parse(new URLSearchParams(body.toString()).get("video"))
const videoPromise = Promise.resolve(video) const videoPromise = Promise.resolve(video)
const instanceOrigin = "http://localhost:3000" const instanceOrigin = "http://localhost:3000"
return renderVideo(videoPromise, {user, id, instanceOrigin}) return renderVideo(videoPromise, {user, id, instanceOrigin}, {mediaFragment})
} }
} }
} }