Skip to content

ActivityPub-federated video streaming platform using P2P directly in your web browser

Use unknown when category is not set

Chocobozzz32fde390f465
diff --git a/scripts/i18n/create-custom-files.ts b/scripts/i18n/create-custom-files.ts
index 3b50459546..eca2fe09d7 100755
--- a/scripts/i18n/create-custom-files.ts
+++ b/scripts/i18n/create-custom-files.ts
@@ -90,7 +90,6 @@ Object.values(VIDEO_CATEGORIES)
// More keys
Object.assign(serverKeys, {
- Misc: 'Misc',
Unknown: 'Unknown'
})
diff --git a/server/models/video/formatter/video-format-utils.ts b/server/models/video/formatter/video-format-utils.ts
index f285db477b..6f05dbdc8b 100644
--- a/server/models/video/formatter/video-format-utils.ts
+++ b/server/models/video/formatter/video-format-utils.ts
@@ -488,7 +488,7 @@ function videoModelToActivityPubObject (video: MVideoAP): VideoObject {
}
function getCategoryLabel (id: number) {
- return VIDEO_CATEGORIES[id] || 'Misc'
+ return VIDEO_CATEGORIES[id] || 'Unknown'
}
function getLicenceLabel (id: number) {
diff --git a/server/tests/api/videos/video-imports.ts b/server/tests/api/videos/video-imports.ts
index 0583134b2e..5636de45f7 100644
--- a/server/tests/api/videos/video-imports.ts
+++ b/server/tests/api/videos/video-imports.ts
@@ -41,7 +41,7 @@ async function checkVideosServer1 (server: PeerTubeServer, idHttp: string, idMag
const videoTorrent = await server.videos.get({ id: idTorrent })
for (const video of [ videoMagnet, videoTorrent ]) {
- expect(video.category.label).to.equal('Misc')
+ expect(video.category.label).to.equal('Unknown')
expect(video.licence.label).to.equal('Unknown')
expect(video.language.label).to.equal('Unknown')
expect(video.nsfw).to.be.false
diff --git a/server/tests/shared/videos.ts b/server/tests/shared/videos.ts
index c8339584ba..f8ec65752b 100644
--- a/server/tests/shared/videos.ts
+++ b/server/tests/shared/videos.ts
@@ -59,7 +59,7 @@ async function completeVideoCheck (
expect(video.name).to.equal(attributes.name)
expect(video.category.id).to.equal(attributes.category)
- expect(video.category.label).to.equal(attributes.category !== null ? VIDEO_CATEGORIES[attributes.category] : 'Misc')
+ expect(video.category.label).to.equal(attributes.category !== null ? VIDEO_CATEGORIES[attributes.category] : 'Unknown')
expect(video.licence.id).to.equal(attributes.licence)
expect(video.licence.label).to.equal(attributes.licence !== null ? VIDEO_LICENCES[attributes.licence] : 'Unknown')
expect(video.language.id).to.equal(attributes.language)