Commit 0a5ca4ab authored by Anton's avatar Anton

Use string replace for video host

parent 9d2f9082
......@@ -15,8 +15,7 @@ const proc = async function () {
for (let anno of annos) {
if (anno.body.source && anno.body.source.id && anno.body.source.id.indexOf(process.env.VIDEO_HOST_OLD) === 0) {
console.log('Modifying', anno.body.source.id)
const url = URL(anno.body.source.id)
anno.body.source.id = `${process.env.VIDEO_HOST_NEW}${url.pathname}`
anno.body.source.id = anno.body.source.id.replace(process.env.VIDEO_HOST_OLD, process.env.VIDEO_HOST_NEW)
console.log('New', anno.body.source.id)
await annoClient.update(anno.uuid, anno, {})
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment