X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=server%2Fmodels%2Fvideo%2Fvideo-streaming-playlist.ts;h=9957ffee3c3b3d1a4dea8bef5ed6338769ad615a;hb=e771ff815dba3b4a95633f4e1e10dacd222dfe61;hp=b15d20cf92417450e44ed5caa0d4bb7437e5e431;hpb=ac27887774e63d99f4e227fbe18846f143cc4b3c;p=github%2FChocobozzz%2FPeerTube.git diff --git a/server/models/video/video-streaming-playlist.ts b/server/models/video/video-streaming-playlist.ts index b15d20cf9..9957ffee3 100644 --- a/server/models/video/video-streaming-playlist.ts +++ b/server/models/video/video-streaming-playlist.ts @@ -1,13 +1,27 @@ -import * as memoizee from 'memoizee' +import memoizee from 'memoizee' import { join } from 'path' import { Op } from 'sequelize' -import { AllowNull, BelongsTo, Column, CreatedAt, DataType, ForeignKey, HasMany, Is, Model, Table, UpdatedAt } from 'sequelize-typescript' -import { doesExist } from '@server/helpers/database-utils' +import { + AllowNull, + BelongsTo, + Column, + CreatedAt, + DataType, + Default, + ForeignKey, + HasMany, + Is, + Model, + Table, + UpdatedAt +} from 'sequelize-typescript' +import { getHLSPublicFileUrl } from '@server/lib/object-storage' import { VideoFileModel } from '@server/models/video/video-file' import { MStreamingPlaylist, MVideo } from '@server/types/models' -import { AttributesOnly } from '@shared/core-utils' +import { sha1 } from '@shared/extra-utils' +import { VideoStorage } from '@shared/models' +import { AttributesOnly } from '@shared/typescript-utils' import { VideoStreamingPlaylistType } from '../../../shared/models/videos/video-streaming-playlist.type' -import { sha1 } from '../../helpers/core-utils' import { isActivityPubUrlValid } from '../../helpers/custom-validators/activitypub/misc' import { isArrayOf } from '../../helpers/custom-validators/misc' import { isVideoFileInfoHashValid } from '../../helpers/custom-validators/videos' @@ -20,6 +34,7 @@ import { WEBSERVER } from '../../initializers/constants' import { VideoRedundancyModel } from '../redundancy/video-redundancy' +import { doesExist } from '../shared' import { throwIfNotValid } from '../utils' import { VideoModel } from './video' @@ -81,6 +96,11 @@ export class VideoStreamingPlaylistModel extends Model VideoModel, { foreignKey: { allowNull: false @@ -178,6 +198,15 @@ export class VideoStreamingPlaylistModel extends Model