Use unknown when category is not set

Unstead of Misc, that could be a real category
pull/5548/head
Chocobozzz 2023-01-19 14:09:57 +01:00
parent 1f6dd00844
commit 32fde390f4
No known key found for this signature in database
GPG Key ID: 583A612D890159BE
4 changed files with 3 additions and 4 deletions

View File

@ -90,7 +90,6 @@ Object.values(VIDEO_CATEGORIES)
// More keys
Object.assign(serverKeys, {
Misc: 'Misc',
Unknown: 'Unknown'
})

View File

@ -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) {

View File

@ -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

View File

@ -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)