mirror of
https://git.sr.ht/~cadence/cloudtube
synced 2026-05-26 12:32:25 +00:00
Normalise info for both channels and search
This commit is contained in:
parent
ac28332ac0
commit
c419aa90da
3 changed files with 28 additions and 11 deletions
|
|
@ -13,16 +13,7 @@ module.exports = [
|
|||
const results = await fetch(fetchURL.toString()).then(res => res.json())
|
||||
|
||||
for (const video of results) {
|
||||
if (!video.second__lengthText && video.lengthSeconds > 0) {
|
||||
video.second__lengthText = converters.lengthSecondsToLengthText(video.lengthSeconds)
|
||||
}
|
||||
if (!video.second__lengthText && video.lengthSeconds === 0) {
|
||||
video.second__lengthText = "LIVE"
|
||||
video.liveNow = true
|
||||
}
|
||||
if (video.publishedText === "0 seconds ago") {
|
||||
video.publishedText = "Live now"
|
||||
}
|
||||
converters.normaliseVideoInfo(video)
|
||||
}
|
||||
|
||||
return render(200, "pug/search.pug", {query, results, instanceOrigin})
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue