Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Framasoft
PeerTube
PeerTube
Commits
32fde390
Verified
Commit
32fde390
authored
Jan 19, 2023
by
Chocobozzz
Browse files
Use unknown when category is not set
Unstead of Misc, that could be a real category
parent
1f6dd008
Changes
4
Hide whitespace changes
Inline
Side-by-side
scripts/i18n/create-custom-files.ts
View file @
32fde390
...
...
@@ -90,7 +90,6 @@ Object.values(VIDEO_CATEGORIES)
// More keys
Object
.
assign
(
serverKeys
,
{
Misc
:
'
Misc
'
,
Unknown
:
'
Unknown
'
})
...
...
server/models/video/formatter/video-format-utils.ts
View file @
32fde390
...
...
@@ -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
)
{
...
...
server/tests/api/videos/video-imports.ts
View file @
32fde390
...
...
@@ -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
...
...
server/tests/shared/videos.ts
View file @
32fde390
...
...
@@ -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
)
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment