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 --- server/tests/cli/prune-storage.ts | 29 +++++++++++++++++------------ 1 file changed, 17 insertions(+), 12 deletions(-) (limited to 'server/tests/cli') diff --git a/server/tests/cli/prune-storage.ts b/server/tests/cli/prune-storage.ts index a723ed8b4..3ca7c19ea 100644 --- a/server/tests/cli/prune-storage.ts +++ b/server/tests/cli/prune-storage.ts @@ -51,7 +51,7 @@ async function assertCountAreOkay (servers: PeerTubeServer[]) { expect(thumbnailsCount).to.equal(6) const avatarsCount = await countFiles(server, 'avatars') - expect(avatarsCount).to.equal(2) + expect(avatarsCount).to.equal(4) const hlsRootCount = await countFiles(server, 'streaming-playlists/hls') expect(hlsRootCount).to.equal(2) @@ -87,23 +87,28 @@ describe('Test prune storage scripts', function () { await doubleFollow(servers[0], servers[1]) - // Lazy load the remote avatar + // Lazy load the remote avatars { const account = await servers[0].accounts.get({ accountName: 'root@localhost:' + servers[1].port }) - await makeGetRequest({ - url: servers[0].url, - path: account.avatar.path, - expectedStatus: HttpStatusCode.OK_200 - }) + + for (const avatar of account.avatars) { + await makeGetRequest({ + url: servers[0].url, + path: avatar.path, + expectedStatus: HttpStatusCode.OK_200 + }) + } } { const account = await servers[1].accounts.get({ accountName: 'root@localhost:' + servers[0].port }) - await makeGetRequest({ - url: servers[1].url, - path: account.avatar.path, - expectedStatus: HttpStatusCode.OK_200 - }) + for (const avatar of account.avatars) { + await makeGetRequest({ + url: servers[1].url, + path: avatar.path, + expectedStatus: HttpStatusCode.OK_200 + }) + } } await wait(1000) -- cgit v1.2.3