mirror of https://github.com/Chocobozzz/PeerTube
Use unknown when category is not set
Unstead of Misc, that could be a real categorypull/5548/head
parent
1f6dd00844
commit
32fde390f4
|
@ -90,7 +90,6 @@ Object.values(VIDEO_CATEGORIES)
|
|||
|
||||
// More keys
|
||||
Object.assign(serverKeys, {
|
||||
Misc: 'Misc',
|
||||
Unknown: 'Unknown'
|
||||
})
|
||||
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue