import { values } from 'lodash'
-import { extname } from 'path'
import { literal, Op, Transaction } from 'sequelize'
import {
AllowNull,
Table,
UpdatedAt
} from 'sequelize-typescript'
+import { getLowercaseExtension } from '@server/helpers/core-utils'
import { ModelCache } from '@server/models/model-cache'
import { AttributesOnly } from '@shared/core-utils'
import { ActivityIconObject, ActivityPubActorType } from '../../../shared/models/activitypub'
}, { where, transaction })
}
- static loadAccountActorByVideoId (videoId: number): Promise<MActor> {
+ static loadAccountActorByVideoId (videoId: number, transaction: Transaction): Promise<MActor> {
const query = {
include: [
{
}
]
}
- ]
+ ],
+ transaction
}
return ActorModel.unscoped().findOne(query)
let image: ActivityIconObject
if (this.avatarId) {
- const extension = extname(this.Avatar.filename)
+ const extension = getLowercaseExtension(this.Avatar.filename)
icon = {
type: 'Image',
if (this.bannerId) {
const banner = (this as MActorAPChannel).Banner
- const extension = extname(banner.filename)
+ const extension = getLowercaseExtension(banner.filename)
image = {
type: 'Image',