PeerTube/server/tests/fixtures/peertube-plugin-test-video-.../main.js

47 lines
1.3 KiB
JavaScript
Raw Normal View History

async function register ({
videoCategoryManager,
videoLicenceManager,
videoLanguageManager,
videoPrivacyManager,
playlistPrivacyManager,
getRouter
}) {
videoLanguageManager.addConstant('al_bhed', 'Al Bhed')
2021-07-21 15:44:28 +02:00
videoLanguageManager.addLanguage('al_bhed2', 'Al Bhed 2')
videoLanguageManager.addConstant('al_bhed3', 'Al Bhed 3')
videoLanguageManager.deleteConstant('en')
2021-07-21 15:44:28 +02:00
videoLanguageManager.deleteLanguage('fr')
videoLanguageManager.deleteConstant('al_bhed3')
2021-07-21 15:44:28 +02:00
videoCategoryManager.addCategory(42, 'Best category')
videoCategoryManager.addConstant(43, 'High best category')
videoCategoryManager.deleteConstant(1) // Music
2021-07-21 15:44:28 +02:00
videoCategoryManager.deleteCategory(2) // Films
2021-07-21 15:44:28 +02:00
videoLicenceManager.addLicence(42, 'Best licence')
videoLicenceManager.addConstant(43, 'High best licence')
videoLicenceManager.deleteConstant(1) // Attribution
videoLicenceManager.deleteConstant(7) // Public domain
videoPrivacyManager.deleteConstant(2)
2021-07-21 15:44:28 +02:00
videoPrivacyManager.deletePrivacy(2)
playlistPrivacyManager.deleteConstant(3)
2021-07-21 15:44:28 +02:00
playlistPrivacyManager.deletePlaylistPrivacy(3)
{
const router = getRouter()
router.get('/reset-categories', (req, res) => {
videoCategoryManager.resetConstants()
res.sendStatus(204)
})
}
}
async function unregister () {}
module.exports = {
register,
unregister
}