diff options
author | Chocobozzz <me@florianbigard.com> | 2020-01-03 14:17:57 +0100 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2020-01-03 14:17:57 +0100 |
commit | ac0868bcc0259d4ff14265d9ae403e10869a13aa (patch) | |
tree | 7a86bc8f4d881360d5b613dc906be1a0d99aa0df /server/typings | |
parent | 35f28e94c763370616d25d5820f4b9ef70cedca9 (diff) | |
download | PeerTube-ac0868bcc0259d4ff14265d9ae403e10869a13aa.tar.gz PeerTube-ac0868bcc0259d4ff14265d9ae403e10869a13aa.tar.zst PeerTube-ac0868bcc0259d4ff14265d9ae403e10869a13aa.zip |
Improve SQL query for my special playlists
Diffstat (limited to 'server/typings')
-rw-r--r-- | server/typings/models/user/user.ts | 10 |
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 { | |||
12 | import { MNotificationSetting, MNotificationSettingFormattable } from './user-notification-setting' | 12 | import { MNotificationSetting, MNotificationSettingFormattable } from './user-notification-setting' |
13 | import { AccountModel } from '@server/models/account/account' | 13 | import { AccountModel } from '@server/models/account/account' |
14 | import { MChannelFormattable } from '../video/video-channels' | 14 | import { MChannelFormattable } from '../video/video-channels' |
15 | import { MVideoPlaylist } from '@server/typings/models' | ||
15 | 16 | ||
16 | type Use<K extends keyof UserModel, M> = PickWith<UserModel, K, M> | 17 | type 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 | ||
69 | type MAccountWithChannels = MAccountFormattable & PickWithOpt<AccountModel, 'VideoChannels', MChannelFormattable[]> | ||
70 | type MAccountWithChannelsAndSpecialPlaylists = MAccountWithChannels & | ||
71 | PickWithOpt<AccountModel, 'VideoPlaylists', MVideoPlaylist[]> | ||
72 | |||
68 | export type MUserFormattable = MUserQuotaUsed & | 73 | export 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 | |||
77 | export type MMyUserFormattable = MUserFormattable & | ||
78 | Use<'Account', MAccountWithChannelsAndSpecialPlaylists> | ||