X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=support%2Fdoc%2Fplugins%2Fguide.md;h=85aaf9f02ffe3300a0d2bb42bb9b25abe0a8e3a2;hb=dc3d902234bb73fbc8cf9787e3036f2012526e6c;hp=568c0662f8bd3eb00b27f3737c068218e291d4e2;hpb=de15b052c59cbd4b99bca835b124485ca1af399e;p=github%2FChocobozzz%2FPeerTube.git diff --git a/support/doc/plugins/guide.md b/support/doc/plugins/guide.md index 568c0662f..85aaf9f02 100644 --- a/support/doc/plugins/guide.md +++ b/support/doc/plugins/guide.md @@ -234,21 +234,29 @@ function register ({ #### Update video constants -You can add/delete video categories, licences or languages using the appropriate managers: +You can add/delete video categories, licences or languages using the appropriate constant managers: ```js -function register (...) { - videoLanguageManager.addLanguage('al_bhed', 'Al Bhed') - videoLanguageManager.deleteLanguage('fr') +function register ({ + videoLanguageManager, + videoCategoryManager, + videoLicenceManager, + videoPrivacyManager, + playlistPrivacyManager +}) { + videoLanguageManager.addConstant('al_bhed', 'Al Bhed') + videoLanguageManager.deleteConstant('fr') - videoCategoryManager.addCategory(42, 'Best category') - videoCategoryManager.deleteCategory(1) // Music + videoCategoryManager.addConstant(42, 'Best category') + videoCategoryManager.deleteConstant(1) // Music + videoCategoryManager.resetConstants() // Reset to initial categories + videoCategoryManager.getConstants() // Retrieve all category constants - videoLicenceManager.addLicence(42, 'Best licence') - videoLicenceManager.deleteLicence(7) // Public domain + videoLicenceManager.addConstant(42, 'Best licence') + videoLicenceManager.deleteConstant(7) // Public domain - videoPrivacyManager.deletePrivacy(2) // Remove Unlisted video privacy - playlistPrivacyManager.deletePlaylistPrivacy(3) // Remove Private video playlist privacy + videoPrivacyManager.deleteConstant(2) // Remove Unlisted video privacy + playlistPrivacyManager.deleteConstant(3) // Remove Private video playlist privacy } ```