From 7eba5e1fa81c8e54cb8fe298a96e8070afa50921 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Tue, 4 Feb 2020 15:00:47 +0100 Subject: Add model cache for video When fetching only immutable attributes --- server/typings/express.ts | 3 ++- server/typings/models/video/video.ts | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) (limited to 'server/typings') diff --git a/server/typings/express.ts b/server/typings/express.ts index 43a9b2c99..f4188bf3d 100644 --- a/server/typings/express.ts +++ b/server/typings/express.ts @@ -21,7 +21,7 @@ import { } from './models' import { MVideoPlaylistFull, MVideoPlaylistFullSummary } from './models/video/video-playlist' import { MVideoImportDefault } from '@server/typings/models/video/video-import' -import { MAccountBlocklist, MActorUrl, MStreamingPlaylist, MVideoFile } from '@server/typings/models' +import { MAccountBlocklist, MActorUrl, MStreamingPlaylist, MVideoFile, MVideoImmutable } from '@server/typings/models' import { MVideoPlaylistElement, MVideoPlaylistElementVideoUrlPlaylistPrivacy } from '@server/typings/models/video/video-playlist-element' import { MAccountVideoRateAccountVideo } from '@server/typings/models/video/video-rate' import { MVideoChangeOwnershipFull } from './models/video/video-change-ownership' @@ -35,6 +35,7 @@ declare module 'express' { locals: { videoAll?: MVideoFullLight + onlyImmutableVideo?: MVideoImmutable onlyVideo?: MVideoThumbnail onlyVideoWithRights?: MVideoWithRights videoId?: MVideoIdThumbnail diff --git a/server/typings/models/video/video.ts b/server/typings/models/video/video.ts index 7eff0a913..3ebb5a762 100644 --- a/server/typings/models/video/video.ts +++ b/server/typings/models/video/video.ts @@ -37,6 +37,7 @@ export type MVideoId = Pick export type MVideoUrl = Pick export type MVideoUUID = Pick +export type MVideoImmutable = Pick export type MVideoIdUrl = MVideoId & MVideoUrl export type MVideoFeed = Pick -- cgit v1.2.3