Add ability to update the banner

This commit is contained in:
Chocobozzz
2021-04-07 17:01:29 +02:00
committed by Chocobozzz
parent 282695e699
commit cdeddff142
42 changed files with 481 additions and 206 deletions

View File

@@ -72,7 +72,11 @@ export class ActorImageModel extends Model {
}
getStaticPath () {
return join(LAZY_STATIC_PATHS.AVATARS, this.filename)
if (this.type === ActorImageType.AVATAR) {
return join(LAZY_STATIC_PATHS.AVATARS, this.filename)
}
return join(LAZY_STATIC_PATHS.BANNERS, this.filename)
}
getPath () {

View File

@@ -71,6 +71,7 @@ import { VideoLiveModel } from '../video/video-live'
import { VideoPlaylistModel } from '../video/video-playlist'
import { AccountModel } from './account'
import { UserNotificationSettingModel } from './user-notification-setting'
import { ActorImageModel } from './actor-image'
enum ScopeNames {
FOR_ME_API = 'FOR_ME_API',
@@ -97,7 +98,20 @@ enum ScopeNames {
model: AccountModel,
include: [
{
model: VideoChannelModel
model: VideoChannelModel.unscoped(),
include: [
{
model: ActorModel,
required: true,
include: [
{
model: ActorImageModel,
as: 'Banner',
required: false
}
]
}
]
},
{
attributes: [ 'id', 'name', 'type' ],