aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/models
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2021-06-08 09:33:03 +0200
committerChocobozzz <me@florianbigard.com>2021-06-08 10:01:50 +0200
commitea54cd04c1ff0e55651cd5fb1a83672acde68604 (patch)
tree4e10fea658e72a9f79375d0e9b23d08915d3d0b2 /server/models
parent295106516277581ba4967199fa5580264a90ae2c (diff)
downloadPeerTube-ea54cd04c1ff0e55651cd5fb1a83672acde68604.tar.gz
PeerTube-ea54cd04c1ff0e55651cd5fb1a83672acde68604.tar.zst
PeerTube-ea54cd04c1ff0e55651cd5fb1a83672acde68604.zip
Fix video upload with a capitalized ext
Diffstat (limited to 'server/models')
-rw-r--r--server/models/actor/actor.ts6
1 files changed, 3 insertions, 3 deletions
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 @@
1import { values } from 'lodash' 1import { values } from 'lodash'
2import { extname } from 'path'
3import { literal, Op, Transaction } from 'sequelize' 2import { literal, Op, Transaction } from 'sequelize'
4import { 3import {
5 AllowNull, 4 AllowNull,
@@ -17,6 +16,7 @@ import {
17 Table, 16 Table,
18 UpdatedAt 17 UpdatedAt
19} from 'sequelize-typescript' 18} from 'sequelize-typescript'
19import { getLowercaseExtension } from '@server/helpers/core-utils'
20import { ModelCache } from '@server/models/model-cache' 20import { ModelCache } from '@server/models/model-cache'
21import { AttributesOnly } from '@shared/core-utils' 21import { AttributesOnly } from '@shared/core-utils'
22import { ActivityIconObject, ActivityPubActorType } from '../../../shared/models/activitypub' 22import { ActivityIconObject, ActivityPubActorType } from '../../../shared/models/activitypub'
@@ -567,7 +567,7 @@ export class ActorModel extends Model<Partial<AttributesOnly<ActorModel>>> {
567 let image: ActivityIconObject 567 let image: ActivityIconObject
568 568
569 if (this.avatarId) { 569 if (this.avatarId) {
570 const extension = extname(this.Avatar.filename) 570 const extension = getLowercaseExtension(this.Avatar.filename)
571 571
572 icon = { 572 icon = {
573 type: 'Image', 573 type: 'Image',
@@ -580,7 +580,7 @@ export class ActorModel extends Model<Partial<AttributesOnly<ActorModel>>> {
580 580
581 if (this.bannerId) { 581 if (this.bannerId) {
582 const banner = (this as MActorAPChannel).Banner 582 const banner = (this as MActorAPChannel).Banner
583 const extension = extname(banner.filename) 583 const extension = getLowercaseExtension(banner.filename)
584 584
585 image = { 585 image = {
586 type: 'Image', 586 type: 'Image',