api: move error context to matcher

This commit is contained in:
wukko
2024-08-24 16:56:07 +06:00
parent 37efa035a2
commit 7ac0726f37
13 changed files with 33 additions and 85 deletions

View File

@@ -38,12 +38,7 @@ export default async function(o) {
return { error: "content.video.live" };
if (videoData.movie.duration > env.durationLimit)
return {
error: "content.too_long",
context: {
limit: env.durationLimit / 60
}
}
return { error: "content.too_long" };
let videos = videoData.videos.filter(v => !v.disallowed);
let bestVideo = videos.find(v => resolutions[v.name] === quality) || videos[videos.length - 1];