aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/typings/models
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2020-01-03 14:17:57 +0100
committerChocobozzz <me@florianbigard.com>2020-01-03 14:17:57 +0100
commitac0868bcc0259d4ff14265d9ae403e10869a13aa (patch)
tree7a86bc8f4d881360d5b613dc906be1a0d99aa0df /server/typings/models
parent35f28e94c763370616d25d5820f4b9ef70cedca9 (diff)
downloadPeerTube-ac0868bcc0259d4ff14265d9ae403e10869a13aa.tar.gz
PeerTube-ac0868bcc0259d4ff14265d9ae403e10869a13aa.tar.zst
PeerTube-ac0868bcc0259d4ff14265d9ae403e10869a13aa.zip
Improve SQL query for my special playlists
Diffstat (limited to 'server/typings/models')
-rw-r--r--server/typings/models/user/user.ts10
1 files changed, 9 insertions, 1 deletions
diff --git a/server/typings/models/user/user.ts b/server/typings/models/user/user.ts
index a2750adc7..6ac19c20b 100644
--- a/server/typings/models/user/user.ts
+++ b/server/typings/models/user/user.ts
@@ -12,6 +12,7 @@ import {
12import { MNotificationSetting, MNotificationSettingFormattable } from './user-notification-setting' 12import { MNotificationSetting, MNotificationSettingFormattable } from './user-notification-setting'
13import { AccountModel } from '@server/models/account/account' 13import { AccountModel } from '@server/models/account/account'
14import { MChannelFormattable } from '../video/video-channels' 14import { MChannelFormattable } from '../video/video-channels'
15import { MVideoPlaylist } from '@server/typings/models'
15 16
16type Use<K extends keyof UserModel, M> = PickWith<UserModel, K, M> 17type Use<K extends keyof UserModel, M> = PickWith<UserModel, K, M>
17 18
@@ -65,6 +66,13 @@ export type MUserDefault = MUser &
65 66
66// Format for API or AP object 67// Format for API or AP object
67 68
69type MAccountWithChannels = MAccountFormattable & PickWithOpt<AccountModel, 'VideoChannels', MChannelFormattable[]>
70type MAccountWithChannelsAndSpecialPlaylists = MAccountWithChannels &
71 PickWithOpt<AccountModel, 'VideoPlaylists', MVideoPlaylist[]>
72
68export type MUserFormattable = MUserQuotaUsed & 73export type MUserFormattable = MUserQuotaUsed &
69 Use<'Account', MAccountFormattable & PickWithOpt<AccountModel, 'VideoChannels', MChannelFormattable[]>> & 74 Use<'Account', MAccountWithChannels> &
70 PickWithOpt<UserModel, 'NotificationSetting', MNotificationSettingFormattable> 75 PickWithOpt<UserModel, 'NotificationSetting', MNotificationSettingFormattable>
76
77export type MMyUserFormattable = MUserFormattable &
78 Use<'Account', MAccountWithChannelsAndSpecialPlaylists>