aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/types/models/user/user-notification.ts
diff options
context:
space:
mode:
authorkontrollanten <6680299+kontrollanten@users.noreply.github.com>2022-02-28 08:34:43 +0100
committerGitHub <noreply@github.com>2022-02-28 08:34:43 +0100
commitd0800f7661f13fabe7bb6f4aa0ea50764f106405 (patch)
treed43e6b0b6f4a5a32e03487e6464edbcaf288be2a /server/types/models/user/user-notification.ts
parent5cad2ca9db9b9d138f8a33058d10b94a9fd50c69 (diff)
downloadPeerTube-d0800f7661f13fabe7bb6f4aa0ea50764f106405.tar.gz
PeerTube-d0800f7661f13fabe7bb6f4aa0ea50764f106405.tar.zst
PeerTube-d0800f7661f13fabe7bb6f4aa0ea50764f106405.zip
Implement avatar miniatures (#4639)
* client: remove unused file * refactor(client/my-actor-avatar): size from input Read size from component input instead of scss, to make it possible to use smaller avatar images when implemented. * implement avatar miniatures close #4560 * fix(test): max file size * fix(search-index): normalize res acc to avatarMini * refactor avatars to an array * client/search: resize channel avatar to 120 * refactor(client/videos): remove unused function * client(actor-avatar): set default size * fix tests and avatars full result When findOne is used only an array containting one avatar is returned. * update migration version and version notations * server/search: harmonize normalizing * Cleanup avatar miniature PR Co-authored-by: Chocobozzz <me@florianbigard.com>
Diffstat (limited to 'server/types/models/user/user-notification.ts')
-rw-r--r--server/types/models/user/user-notification.ts9
1 files changed, 5 insertions, 4 deletions
diff --git a/server/types/models/user/user-notification.ts b/server/types/models/user/user-notification.ts
index db9ec0400..d4715a0b6 100644
--- a/server/types/models/user/user-notification.ts
+++ b/server/types/models/user/user-notification.ts
@@ -21,6 +21,7 @@ type Use<K extends keyof UserNotificationModel, M> = PickWith<UserNotificationMo
21// ############################################################################ 21// ############################################################################
22 22
23export module UserNotificationIncludes { 23export module UserNotificationIncludes {
24 export type ActorImageInclude = Pick<ActorImageModel, 'createdAt' | 'filename' | 'getStaticPath' | 'width' | 'updatedAt'>
24 25
25 export type VideoInclude = Pick<VideoModel, 'id' | 'uuid' | 'name'> 26 export type VideoInclude = Pick<VideoModel, 'id' | 'uuid' | 'name'>
26 export type VideoIncludeChannel = 27 export type VideoIncludeChannel =
@@ -29,7 +30,7 @@ export module UserNotificationIncludes {
29 30
30 export type ActorInclude = 31 export type ActorInclude =
31 Pick<ActorModel, 'preferredUsername' | 'getHost'> & 32 Pick<ActorModel, 'preferredUsername' | 'getHost'> &
32 PickWith<ActorModel, 'Avatar', Pick<ActorImageModel, 'filename' | 'getStaticPath'>> & 33 PickWith<ActorModel, 'Avatars', ActorImageInclude[]> &
33 PickWith<ActorModel, 'Server', Pick<ServerModel, 'host'>> 34 PickWith<ActorModel, 'Server', Pick<ServerModel, 'host'>>
34 35
35 export type VideoChannelInclude = Pick<VideoChannelModel, 'id' | 'name' | 'getDisplayName'> 36 export type VideoChannelInclude = Pick<VideoChannelModel, 'id' | 'name' | 'getDisplayName'>
@@ -75,7 +76,7 @@ export module UserNotificationIncludes {
75 Pick<ActorModel, 'preferredUsername' | 'getHost'> & 76 Pick<ActorModel, 'preferredUsername' | 'getHost'> &
76 PickWith<ActorModel, 'Account', AccountInclude> & 77 PickWith<ActorModel, 'Account', AccountInclude> &
77 PickWith<ActorModel, 'Server', Pick<ServerModel, 'host'>> & 78 PickWith<ActorModel, 'Server', Pick<ServerModel, 'host'>> &
78 PickWithOpt<ActorModel, 'Avatar', Pick<ActorImageModel, 'filename' | 'getStaticPath'>> 79 PickWithOpt<ActorModel, 'Avatars', ActorImageInclude[]>
79 80
80 export type ActorFollowing = 81 export type ActorFollowing =
81 Pick<ActorModel, 'preferredUsername' | 'type' | 'getHost'> & 82 Pick<ActorModel, 'preferredUsername' | 'type' | 'getHost'> &
@@ -98,7 +99,7 @@ export module UserNotificationIncludes {
98// ############################################################################ 99// ############################################################################
99 100
100export type MUserNotification = 101export type MUserNotification =
101 Omit<UserNotificationModel, 'User' | 'Video' | 'Comment' | 'Abuse' | 'VideoBlacklist' | 102 Omit<UserNotificationModel, 'User' | 'Video' | 'VideoComment' | 'Abuse' | 'VideoBlacklist' |
102 'VideoImport' | 'Account' | 'ActorFollow' | 'Plugin' | 'Application'> 103 'VideoImport' | 'Account' | 'ActorFollow' | 'Plugin' | 'Application'>
103 104
104// ############################################################################ 105// ############################################################################
@@ -106,7 +107,7 @@ export type MUserNotification =
106export type UserNotificationModelForApi = 107export type UserNotificationModelForApi =
107 MUserNotification & 108 MUserNotification &
108 Use<'Video', UserNotificationIncludes.VideoIncludeChannel> & 109 Use<'Video', UserNotificationIncludes.VideoIncludeChannel> &
109 Use<'Comment', UserNotificationIncludes.VideoCommentInclude> & 110 Use<'VideoComment', UserNotificationIncludes.VideoCommentInclude> &
110 Use<'Abuse', UserNotificationIncludes.AbuseInclude> & 111 Use<'Abuse', UserNotificationIncludes.AbuseInclude> &
111 Use<'VideoBlacklist', UserNotificationIncludes.VideoBlacklistInclude> & 112 Use<'VideoBlacklist', UserNotificationIncludes.VideoBlacklistInclude> &
112 Use<'VideoImport', UserNotificationIncludes.VideoImportInclude> & 113 Use<'VideoImport', UserNotificationIncludes.VideoImportInclude> &