]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/types/models/actor/actor.ts
Remove uneeded memoize
[github/Chocobozzz/PeerTube.git] / server / types / models / actor / actor.ts
index b3a70cbcef408646ceaf43ac475143b3c0ee0ebf..280256bab209c9d414e25bd66ad701c6faf31910 100644 (file)
@@ -1,4 +1,4 @@
-import { FunctionProperties, PickWith, PickWithOpt } from '@shared/core-utils'
+import { FunctionProperties, PickWith, PickWithOpt } from '@shared/typescript-utils'
 import { ActorModel } from '../../../models/actor/actor'
 import { MAccount, MAccountDefault, MAccountId, MAccountIdActor } from '../account'
 import { MServer, MServerHost, MServerHostBlocks, MServerRedundancyAllowed } from '../server'
@@ -10,7 +10,7 @@ type UseOpt<K extends keyof ActorModel, M> = PickWithOpt<ActorModel, K, M>
 
 // ############################################################################
 
-export type MActor = Omit<ActorModel, 'Account' | 'VideoChannel' | 'ActorFollowing' | 'Avatar' | 'ActorFollowers' | 'Server' | 'Banner'>
+export type MActor = Omit<ActorModel, 'Account' | 'VideoChannel' | 'ActorFollowing' | 'ActorFollowers' | 'Server' | 'Banners'>
 
 // ############################################################################
 
@@ -35,7 +35,7 @@ export type MActorRedundancyAllowedOpt = PickWithOpt<ActorModel, 'Server', MServ
 export type MActorDefaultLight =
   MActorLight &
   Use<'Server', MServerHost> &
-  Use<'Avatar', MActorImage>
+  Use<'Avatars', MActorImage[]>
 
 export type MActorAccountId =
   MActor &
@@ -78,13 +78,13 @@ export type MActorServer =
 
 export type MActorImages =
   MActor &
-  Use<'Avatar', MActorImage> &
-  UseOpt<'Banner', MActorImage>
+  Use<'Avatars', MActorImage[]> &
+  UseOpt<'Banners', MActorImage[]>
 
 export type MActorDefault =
   MActor &
   Use<'Server', MServer> &
-  Use<'Avatar', MActorImage>
+  Use<'Avatars', MActorImage[]>
 
 export type MActorDefaultChannelId =
   MActorDefault &
@@ -93,8 +93,8 @@ export type MActorDefaultChannelId =
 export type MActorDefaultBanner =
   MActor &
   Use<'Server', MServer> &
-  Use<'Avatar', MActorImage> &
-  Use<'Banner', MActorImage>
+  Use<'Avatars', MActorImage[]> &
+  Use<'Banners', MActorImage[]>
 
 // Actor with channel that is associated to an account and its actor
 // Actor -> VideoChannel -> Account -> Actor
@@ -105,8 +105,8 @@ export type MActorChannelAccountActor =
 export type MActorFull =
   MActor &
   Use<'Server', MServer> &
-  Use<'Avatar', MActorImage> &
-  Use<'Banner', MActorImage> &
+  Use<'Avatars', MActorImage[]> &
+  Use<'Banners', MActorImage[]> &
   Use<'Account', MAccount> &
   Use<'VideoChannel', MChannelAccountActor>
 
@@ -114,8 +114,8 @@ export type MActorFull =
 export type MActorFullActor =
   MActor &
   Use<'Server', MServer> &
-  Use<'Avatar', MActorImage> &
-  Use<'Banner', MActorImage> &
+  Use<'Avatars', MActorImage[]> &
+  Use<'Banners', MActorImage[]> &
   Use<'Account', MAccountDefault> &
   Use<'VideoChannel', MChannelAccountDefault>
 
@@ -125,9 +125,9 @@ export type MActorFullActor =
 
 export type MActorSummary =
   FunctionProperties<MActor> &
-  Pick<MActor, 'id' | 'preferredUsername' | 'url' | 'serverId' | 'avatarId'> &
+  Pick<MActor, 'id' | 'preferredUsername' | 'url' | 'serverId'> &
   Use<'Server', MServerHost> &
-  Use<'Avatar', MActorImage>
+  Use<'Avatars', MActorImage[]>
 
 export type MActorSummaryBlocks =
   MActorSummary &
@@ -145,21 +145,22 @@ export type MActorSummaryFormattable =
   FunctionProperties<MActor> &
   Pick<MActor, 'url' | 'preferredUsername'> &
   Use<'Server', MServerHost> &
-  Use<'Avatar', MActorImageFormattable>
+  Use<'Avatars', MActorImageFormattable[]>
 
 export type MActorFormattable =
   MActorSummaryFormattable &
-  Pick<MActor, 'id' | 'followingCount' | 'followersCount' | 'createdAt' | 'updatedAt' | 'remoteCreatedAt' | 'bannerId' | 'avatarId'> &
+  Pick<MActor, 'id' | 'followingCount' | 'followersCount' | 'createdAt' | 'updatedAt' | 'remoteCreatedAt'> &
   Use<'Server', MServerHost & Partial<Pick<MServer, 'redundancyAllowed'>>> &
-  UseOpt<'Banner', MActorImageFormattable>
+  UseOpt<'Banners', MActorImageFormattable[]> &
+  UseOpt<'Avatars', MActorImageFormattable[]>
 
 type MActorAPBase =
   MActor &
-  Use<'Avatar', MActorImage>
+  Use<'Avatars', MActorImage[]>
 
 export type MActorAPAccount =
   MActorAPBase
 
 export type MActorAPChannel =
   MActorAPBase &
-  Use<'Banner', MActorImage>
+  Use<'Banners', MActorImage[]>