diff options
author | Chocobozzz <me@florianbigard.com> | 2020-02-04 15:00:47 +0100 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2020-02-04 15:00:47 +0100 |
commit | 7eba5e1fa81c8e54cb8fe298a96e8070afa50921 (patch) | |
tree | a6bd4b13dc0d65addfa82fcf200f2d1853a0723a /server/typings | |
parent | e436baf0b00b3ecf3731aeba02437ebe4906ac5f (diff) | |
download | PeerTube-7eba5e1fa81c8e54cb8fe298a96e8070afa50921.tar.gz PeerTube-7eba5e1fa81c8e54cb8fe298a96e8070afa50921.tar.zst PeerTube-7eba5e1fa81c8e54cb8fe298a96e8070afa50921.zip |
Add model cache for video
When fetching only immutable attributes
Diffstat (limited to 'server/typings')
-rw-r--r-- | server/typings/express.ts | 3 | ||||
-rw-r--r-- | server/typings/models/video/video.ts | 1 |
2 files changed, 3 insertions, 1 deletions
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 { | |||
21 | } from './models' | 21 | } from './models' |
22 | import { MVideoPlaylistFull, MVideoPlaylistFullSummary } from './models/video/video-playlist' | 22 | import { MVideoPlaylistFull, MVideoPlaylistFullSummary } from './models/video/video-playlist' |
23 | import { MVideoImportDefault } from '@server/typings/models/video/video-import' | 23 | import { MVideoImportDefault } from '@server/typings/models/video/video-import' |
24 | import { MAccountBlocklist, MActorUrl, MStreamingPlaylist, MVideoFile } from '@server/typings/models' | 24 | import { MAccountBlocklist, MActorUrl, MStreamingPlaylist, MVideoFile, MVideoImmutable } from '@server/typings/models' |
25 | import { MVideoPlaylistElement, MVideoPlaylistElementVideoUrlPlaylistPrivacy } from '@server/typings/models/video/video-playlist-element' | 25 | import { MVideoPlaylistElement, MVideoPlaylistElementVideoUrlPlaylistPrivacy } from '@server/typings/models/video/video-playlist-element' |
26 | import { MAccountVideoRateAccountVideo } from '@server/typings/models/video/video-rate' | 26 | import { MAccountVideoRateAccountVideo } from '@server/typings/models/video/video-rate' |
27 | import { MVideoChangeOwnershipFull } from './models/video/video-change-ownership' | 27 | import { MVideoChangeOwnershipFull } from './models/video/video-change-ownership' |
@@ -35,6 +35,7 @@ declare module 'express' { | |||
35 | 35 | ||
36 | locals: { | 36 | locals: { |
37 | videoAll?: MVideoFullLight | 37 | videoAll?: MVideoFullLight |
38 | onlyImmutableVideo?: MVideoImmutable | ||
38 | onlyVideo?: MVideoThumbnail | 39 | onlyVideo?: MVideoThumbnail |
39 | onlyVideoWithRights?: MVideoWithRights | 40 | onlyVideoWithRights?: MVideoWithRights |
40 | videoId?: MVideoIdThumbnail | 41 | 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<MVideo, 'id'> | |||
37 | export type MVideoUrl = Pick<MVideo, 'url'> | 37 | export type MVideoUrl = Pick<MVideo, 'url'> |
38 | export type MVideoUUID = Pick<MVideo, 'uuid'> | 38 | export type MVideoUUID = Pick<MVideo, 'uuid'> |
39 | 39 | ||
40 | export type MVideoImmutable = Pick<MVideo, 'id' | 'url' | 'uuid'> | ||
40 | export type MVideoIdUrl = MVideoId & MVideoUrl | 41 | export type MVideoIdUrl = MVideoId & MVideoUrl |
41 | export type MVideoFeed = Pick<MVideo, 'name' | 'uuid'> | 42 | export type MVideoFeed = Pick<MVideo, 'name' | 'uuid'> |
42 | 43 | ||