peertube-plugin-category-manager
v1.0.1
Published
A plugin for managing video categories in PeerTube. Allows administrators to define a custom list of categories and/or remove default categories.
Downloads
9
Readme
PeerTube plugin — Category Manager
A small PeerTube plugin that lets administrators define additional video categories from the admin settings (as JSON) and optionally remove PeerTube's default categories (IDs 1–18). The plugin registers those categories on the server and on clients so they appear in the category list like built-in categories.
Features
- Add arbitrary extra categories via a JSON array in the plugin settings.
- Optionally remove/replace the PeerTube default categories (IDs 1–18).
- Exposes a simple server endpoint so client code can fetch the configured categories.
Configuration (plugin settings)
The plugin exposes two settings in the PeerTube admin UI:
additionalCategories(textarea): a JSON array of category objects. Each object must contain:key(number): the numeric ID of the category. Avoid using 1–18 unless you intentionally want to replace a core category.label(string): the display label for the category.
Example value for
additionalCategories:[ { "key": 19, "label": "Cooking" }, { "key": 20, "label": "Kids" } ]replaceDefaultCategories(checkbox): When enabled, the plugin will attempt to delete the PeerTube default categories listed in the plugin (IDs 1–18) before adding your custom categories. This is optional — use it only if you want to hide/replace the default categories.
Behavior notes:
- The plugin is careful not to delete anything outside the known default list. It only attempts to remove keys present in the built-in
defaultCategoryKeys(1–18 by default). - Invalid JSON in
additionalCategoriesis treated as an empty list (no categories will be added).
Troubleshooting
- If categories don't show up on clients:
- Ensure the plugin is enabled in the PeerTube admin UI and you restarted the server.
- Confirm
additionalCategoriescontains valid JSON and validkey/labelvalues. - Check server logs for messages from the plugin and client browser console for warnings prefixed with
category-manager:.
Contributing
Contributions are welcome. Please open issues or merge requests in the repository hosting this plugin.
License
See the LICENSE file included with this repository.
