1
0
mirror of https://git.sr.ht/~cadence/cloudtube synced 2024-11-12 19:37:29 +00:00

Tip: Don't code at 1 AM

- Remove console.log
- Default value for render video locals
This commit is contained in:
Cadence Ember 2021-01-14 01:49:26 +13:00
parent bb4816c4b3
commit c83bdcb924
No known key found for this signature in database
GPG Key ID: BC1C2C61CF521B17
2 changed files with 2 additions and 3 deletions

View File

@ -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

View File

@ -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