Add filter:api.video.post-import-url.accept.result

This commit is contained in:
Chocobozzz 2020-05-18 10:04:58 +02:00
parent ee372c178a
commit 7dbee69153
No known key found for this signature in database
GPG Key ID: 583A612D890159BE

View File

@ -35,6 +35,16 @@ async function register ({
}
})
registerHook({
target: 'filter:api.video.post-import-url.accept.result',
handler: ({ accepted }, { video }) => {
if (!accepted) return { accepted: false }
if (video.name.includes('small video - youtube')) return { accepted: false, errorMessage: 'bad word' }
return { accepted: true }
}
})
registerSetting({
name: 'admin-name',
label: 'Admin name',