(
video:
| {
duration: number | null;
width: number | null;
height: number | null;
fps: number | null;
}
| undefined,
)
| 321 | } |
| 322 | |
| 323 | function getMetadataFromVideoRow( |
| 324 | video: |
| 325 | | { |
| 326 | duration: number | null; |
| 327 | width: number | null; |
| 328 | height: number | null; |
| 329 | fps: number | null; |
| 330 | } |
| 331 | | undefined, |
| 332 | ): MediaServerProcessResult["metadata"] | null { |
| 333 | if ( |
| 334 | !video || |
| 335 | !isPositiveNumber(video.width) || |
| 336 | !isPositiveNumber(video.height) || |
| 337 | !isPositiveNumber(video.fps) |
| 338 | ) { |
| 339 | return null; |
| 340 | } |
| 341 | |
| 342 | return { |
| 343 | duration: isPositiveNumber(video.duration) ? video.duration : 0, |
| 344 | width: video.width, |
| 345 | height: video.height, |
| 346 | fps: video.fps, |
| 347 | }; |
| 348 | } |
| 349 | |
| 350 | async function getCompletedMetadata( |
| 351 | videoId: string, |
no test coverage detected