From ebdc88fe4cdb7c605bee69bdaca316c5767b90f8 Mon Sep 17 00:00:00 2001 From: Cadence Ember Date: Wed, 3 Feb 2021 21:04:48 +1300 Subject: [PATCH] Fix media fragments in local mode --- api/video.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/api/video.js b/api/video.js index b27360e..315de3a 100644 --- a/api/video.js +++ b/api/video.js @@ -123,9 +123,9 @@ module.exports = [ const user = getUser(req) const settings = user.getSettingsOrDefaults() const id = url.searchParams.get("v") + const t = url.searchParams.get("t") + let mediaFragment = converters.tToMediaFragment(t) if (req.method === "GET") { - const t = url.searchParams.get("t") - let mediaFragment = converters.tToMediaFragment(t) if (!settings.local) { const instanceOrigin = settings.instance const outURL = `${instanceOrigin}/api/v1/videos/${id}` @@ -138,7 +138,7 @@ module.exports = [ const video = JSON.parse(new URLSearchParams(body.toString()).get("video")) const videoPromise = Promise.resolve(video) const instanceOrigin = "http://localhost:3000" - return renderVideo(videoPromise, {user, id, instanceOrigin}) + return renderVideo(videoPromise, {user, id, instanceOrigin}, {mediaFragment}) } } }