X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=server%2Fmodels%2Factor%2Factor.ts;h=0cd30f5451ad693ea8d65746c5db0b5cee4d22ab;hb=79db409a41bd28fd2773626c9a93b5d326a38bc0;hp=65c53f8f8a01f49decd5ff0b5ae855395da75388;hpb=4d7ce9218a3f695bf3d013cbdce1c5c6a5221927;p=github%2FChocobozzz%2FPeerTube.git diff --git a/server/models/actor/actor.ts b/server/models/actor/actor.ts index 65c53f8f8..0cd30f545 100644 --- a/server/models/actor/actor.ts +++ b/server/models/actor/actor.ts @@ -1,5 +1,4 @@ import { values } from 'lodash' -import { extname } from 'path' import { literal, Op, Transaction } from 'sequelize' import { AllowNull, @@ -17,6 +16,7 @@ import { 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' @@ -567,7 +567,7 @@ export class ActorModel extends Model>> { let image: ActivityIconObject if (this.avatarId) { - const extension = extname(this.Avatar.filename) + const extension = getLowercaseExtension(this.Avatar.filename) icon = { type: 'Image', @@ -580,7 +580,7 @@ export class ActorModel extends Model>> { if (this.bannerId) { const banner = (this as MActorAPChannel).Banner - const extension = extname(banner.filename) + const extension = getLowercaseExtension(banner.filename) image = { type: 'Image',