nfp_sites/filadelfia_archive/api/article/util.mjs
Jonatan Nilsson 329a3e267c
Some checks reported warnings
/ deploy (push) Has been cancelled
filadelfia_archive: Rename
2023-11-30 04:21:05 +00:00

19 lines
No EOL
426 B
JavaScript

import { parseMediaAndBanner } from "../../base/util.mjs"
export function parseVideos(videos) {
for (let i = 0; i < videos.length; i++) {
parseVideo(videos[i])
}
return videos
}
export function parseVideo(video) {
if (!video) {
return null
}
parseMediaAndBanner(video)
video.metadata = JSON.parse(video.metadata || '{}')
delete video.banner_alt_prefix
delete video.media_alt_prefix
return video
}