From d0800f7661f13fabe7bb6f4aa0ea50764f106405 Mon Sep 17 00:00:00 2001 From: kontrollanten <6680299+kontrollanten@users.noreply.github.com> Date: Mon, 28 Feb 2022 08:34:43 +0100 Subject: 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 --- shared/server-commands/videos/channels.ts | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'shared/server-commands/videos') diff --git a/shared/server-commands/videos/channels.ts b/shared/server-commands/videos/channels.ts index 756c47453..3c0d4b723 100644 --- a/shared/server-commands/videos/channels.ts +++ b/shared/server-commands/videos/channels.ts @@ -13,6 +13,17 @@ function setDefaultVideoChannel (servers: PeerTubeServer[]) { return Promise.all(tasks) } +async function setDefaultChannelAvatar (serversArg: PeerTubeServer | PeerTubeServer[], channelName: string = 'root_channel') { + const servers = Array.isArray(serversArg) + ? serversArg + : [ serversArg ] + + for (const server of servers) { + await server.channels.updateImage({ channelName, fixture: 'avatar.png', type: 'avatar' }) + } +} + export { - setDefaultVideoChannel + setDefaultVideoChannel, + setDefaultChannelAvatar } -- cgit v1.2.3