1
0
Fork 0
mirror of https://github.com/Chocobozzz/PeerTube.git synced 2025-10-04 02:09:37 +02:00

Optimize config endpoint

This commit is contained in:
Chocobozzz 2024-03-12 16:00:51 +01:00
parent 0f67adf98a
commit 486b4a329f
No known key found for this signature in database
GPG key ID: 583A612D890159BE
4 changed files with 16 additions and 13 deletions

View file

@ -1,7 +1,8 @@
import { getNodeABIVersion } from '@server/helpers/version.js'
import memoizee from 'memoizee'
import { AllowNull, Column, Default, DefaultScope, HasOne, IsInt, Table } from 'sequelize-typescript'
import { getNodeABIVersion } from '@server/helpers/version.js'
import { AccountModel } from '../account/account.js'
import { ActorImageModel } from '../actor/actor-image.js'
import { SequelizeModel } from '../shared/index.js'
export const getServerActor = memoizee(async function () {
@ -11,6 +12,10 @@ export const getServerActor = memoizee(async function () {
const actor = application.Account.Actor
actor.Account = application.Account
const { avatars, banners } = await ActorImageModel.listActorImages(actor)
actor.Avatars = avatars
actor.Banners = banners
return actor
}, { promise: true })