mirror of
https://github.com/Chocobozzz/PeerTube.git
synced 2025-10-04 18:29:27 +02:00
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>
This commit is contained in:
parent
5cad2ca9db
commit
d0800f7661
150 changed files with 2027 additions and 1276 deletions
|
@ -3,6 +3,7 @@ import { readFile } from 'fs-extra'
|
|||
import { join } from 'path'
|
||||
import validator from 'validator'
|
||||
import { toCompleteUUID } from '@server/helpers/custom-validators/misc'
|
||||
import { ActorImageModel } from '@server/models/actor/actor-image'
|
||||
import { root } from '@shared/core-utils'
|
||||
import { escapeHTML } from '@shared/core-utils/renderer'
|
||||
import { sha256 } from '@shared/extra-utils'
|
||||
|
@ -16,7 +17,6 @@ import { mdToOneLinePlainText } from '../helpers/markdown'
|
|||
import { CONFIG } from '../initializers/config'
|
||||
import {
|
||||
ACCEPT_HEADERS,
|
||||
ACTOR_IMAGES_SIZE,
|
||||
CUSTOM_HTML_TAG_COMMENTS,
|
||||
EMBED_SIZE,
|
||||
FILES_CONTENT_HASH,
|
||||
|
@ -29,6 +29,7 @@ import { VideoModel } from '../models/video/video'
|
|||
import { VideoChannelModel } from '../models/video/video-channel'
|
||||
import { VideoPlaylistModel } from '../models/video/video-playlist'
|
||||
import { MAccountActor, MChannelActor } from '../types/models'
|
||||
import { getBiggestActorImage } from './actor-image'
|
||||
import { ServerConfigManager } from './server-config-manager'
|
||||
|
||||
type Tags = {
|
||||
|
@ -273,10 +274,11 @@ class ClientHtml {
|
|||
const siteName = CONFIG.INSTANCE.NAME
|
||||
const title = entity.getDisplayName()
|
||||
|
||||
const avatar = getBiggestActorImage(entity.Actor.Avatars)
|
||||
const image = {
|
||||
url: entity.Actor.getAvatarUrl(),
|
||||
width: ACTOR_IMAGES_SIZE.AVATARS.width,
|
||||
height: ACTOR_IMAGES_SIZE.AVATARS.height
|
||||
url: ActorImageModel.getImageUrl(avatar),
|
||||
width: avatar?.width,
|
||||
height: avatar?.height
|
||||
}
|
||||
|
||||
const ogType = 'website'
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue