mirror of
https://github.com/Chocobozzz/PeerTube.git
synced 2025-10-06 03:50:26 +02:00
Move video file metadata in their own table
Will be used for user video quotas and multiple video resolutions
This commit is contained in:
parent
69f224587e
commit
93e1258c7c
30 changed files with 818 additions and 340 deletions
|
@ -23,10 +23,11 @@ import {
|
|||
isVideoNSFWValid,
|
||||
isVideoDescriptionValid,
|
||||
isVideoDurationValid,
|
||||
isVideoInfoHashValid,
|
||||
isVideoFileInfoHashValid,
|
||||
isVideoNameValid,
|
||||
isVideoTagsValid,
|
||||
isVideoExtnameValid
|
||||
isVideoFileExtnameValid,
|
||||
isVideoFileResolutionValid
|
||||
} from '../videos'
|
||||
|
||||
const ENDPOINT_ACTIONS = REQUEST_ENDPOINT_ACTIONS[REQUEST_ENDPOINTS.VIDEOS]
|
||||
|
@ -121,14 +122,22 @@ function isCommonVideoAttributesValid (video: any) {
|
|||
isVideoNSFWValid(video.nsfw) &&
|
||||
isVideoDescriptionValid(video.description) &&
|
||||
isVideoDurationValid(video.duration) &&
|
||||
isVideoInfoHashValid(video.infoHash) &&
|
||||
isVideoNameValid(video.name) &&
|
||||
isVideoTagsValid(video.tags) &&
|
||||
isVideoUUIDValid(video.uuid) &&
|
||||
isVideoExtnameValid(video.extname) &&
|
||||
isVideoViewsValid(video.views) &&
|
||||
isVideoLikesValid(video.likes) &&
|
||||
isVideoDislikesValid(video.dislikes)
|
||||
isVideoDislikesValid(video.dislikes) &&
|
||||
isArray(video.files) &&
|
||||
video.files.every(videoFile => {
|
||||
if (!videoFile) return false
|
||||
|
||||
return (
|
||||
isVideoFileInfoHashValid(videoFile.infoHash) &&
|
||||
isVideoFileExtnameValid(videoFile.extname) &&
|
||||
isVideoFileResolutionValid(videoFile.resolution)
|
||||
)
|
||||
})
|
||||
}
|
||||
|
||||
function isRequestTypeAddValid (value: string) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue