From c83bdcb924bb1bd445fce07691ae4f9eaa23867f Mon Sep 17 00:00:00 2001 From: Cadence Ember Date: Thu, 14 Jan 2021 01:49:26 +1300 Subject: [PATCH] Tip: Don't code at 1 AM - Remove console.log - Default value for render video locals --- api/video.js | 2 +- utils/converters.js | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/api/video.js b/api/video.js index 401a3d6..c8b0ad6 100644 --- a/api/video.js +++ b/api/video.js @@ -36,7 +36,7 @@ function formatOrder(format) { return -total } -async function renderVideo(videoPromise, {user, id, instanceOrigin}, locals) { +async function renderVideo(videoPromise, {user, id, instanceOrigin}, locals = {}) { try { // resolve video const video = await videoPromise diff --git a/utils/converters.js b/utils/converters.js index f1b61bd..09c0435 100644 --- a/utils/converters.js +++ b/utils/converters.js @@ -59,8 +59,7 @@ function normaliseVideoInfo(video) { function tToMediaFragment(t) { let resolved = "" - console.log(t) - if (!t || t.length > 10) { // don't parse missing values, don't pass too long strings + if (!t || t.length > 10) { // don't parse missing values, don't parse too long strings // skip processing } else if (t.match(/^[0-9.,]+$/)) { resolved = t