X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;ds=sidebyside;f=server%2Fmodels%2Fvideo%2Fvideo-caption.ts;h=2eaa77407e35740f99bc72c92402a90d7089f55e;hb=26818a73ba0d7fd53ca69eba0c8e525f3670b5a8;hp=b4918e519f59ba7cf89adb9fc0d9c58e8d2be6b9;hpb=57a0a9cde4760314d9b1fdd920e0b4a180a9925e;p=github%2FChocobozzz%2FPeerTube.git diff --git a/server/models/video/video-caption.ts b/server/models/video/video-caption.ts index b4918e519..2eaa77407 100644 --- a/server/models/video/video-caption.ts +++ b/server/models/video/video-caption.ts @@ -15,15 +15,15 @@ import { Table, UpdatedAt } from 'sequelize-typescript' -import { v4 as uuidv4 } from 'uuid' import { MVideo, MVideoCaption, MVideoCaptionFormattable, MVideoCaptionVideo } from '@server/types/models' -import { AttributesOnly } from '@shared/core-utils' +import { buildUUID } from '@shared/extra-utils' +import { AttributesOnly } from '@shared/typescript-utils' import { VideoCaption } from '../../../shared/models/videos/caption/video-caption.model' import { isVideoCaptionLanguageValid } from '../../helpers/custom-validators/video-captions' import { logger } from '../../helpers/logger' import { CONFIG } from '../../initializers/config' import { CONSTRAINTS_FIELDS, LAZY_STATIC_PATHS, VIDEO_LANGUAGES, WEBSERVER } from '../../initializers/constants' -import { buildWhereIdOrUUID, throwIfNotValid } from '../utils' +import { buildWhereIdOrUUID, throwIfNotValid } from '../shared' import { VideoModel } from './video' export enum ScopeNames { @@ -91,9 +91,9 @@ export class VideoCaptionModel extends Model { + static listVideoCaptions (videoId: number, transaction?: Transaction): Promise { const query = { order: [ [ 'language', 'ASC' ] ] as OrderItem[], where: { @@ -182,7 +182,7 @@ export class VideoCaptionModel extends Model