aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/lib
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2018-02-13 18:17:05 +0100
committerChocobozzz <me@florianbigard.com>2018-02-14 16:03:09 +0100
commitac81d1a06d57b9ae86663831e7f5edcef57b0fa4 (patch)
treeda31775c9533d3e270f68f921e146f086bf7c0b8 /server/lib
parente883399fa6caa56bb8519c9a2e22d88001f26661 (diff)
downloadPeerTube-ac81d1a06d57b9ae86663831e7f5edcef57b0fa4.tar.gz
PeerTube-ac81d1a06d57b9ae86663831e7f5edcef57b0fa4.tar.zst
PeerTube-ac81d1a06d57b9ae86663831e7f5edcef57b0fa4.zip
Add ability to set video thumbnail/preview
Diffstat (limited to 'server/lib')
-rw-r--r--server/lib/activitypub/actor.ts6
1 files changed, 3 insertions, 3 deletions
diff --git a/server/lib/activitypub/actor.ts b/server/lib/activitypub/actor.ts
index 712de7d0d..c3255d8ca 100644
--- a/server/lib/activitypub/actor.ts
+++ b/server/lib/activitypub/actor.ts
@@ -12,7 +12,7 @@ import { logger } from '../../helpers/logger'
12import { createPrivateAndPublicKeys } from '../../helpers/peertube-crypto' 12import { createPrivateAndPublicKeys } from '../../helpers/peertube-crypto'
13import { doRequest, doRequestAndSaveToFile } from '../../helpers/requests' 13import { doRequest, doRequestAndSaveToFile } from '../../helpers/requests'
14import { getUrlFromWebfinger } from '../../helpers/webfinger' 14import { getUrlFromWebfinger } from '../../helpers/webfinger'
15import { AVATAR_MIMETYPE_EXT, CONFIG, sequelizeTypescript } from '../../initializers' 15import { IMAGE_MIMETYPE_EXT, CONFIG, sequelizeTypescript } from '../../initializers'
16import { AccountModel } from '../../models/account/account' 16import { AccountModel } from '../../models/account/account'
17import { ActorModel } from '../../models/activitypub/actor' 17import { ActorModel } from '../../models/activitypub/actor'
18import { AvatarModel } from '../../models/avatar/avatar' 18import { AvatarModel } from '../../models/avatar/avatar'
@@ -147,10 +147,10 @@ async function fetchActorTotalItems (url: string) {
147 147
148async function fetchAvatarIfExists (actorJSON: ActivityPubActor) { 148async function fetchAvatarIfExists (actorJSON: ActivityPubActor) {
149 if ( 149 if (
150 actorJSON.icon && actorJSON.icon.type === 'Image' && AVATAR_MIMETYPE_EXT[actorJSON.icon.mediaType] !== undefined && 150 actorJSON.icon && actorJSON.icon.type === 'Image' && IMAGE_MIMETYPE_EXT[actorJSON.icon.mediaType] !== undefined &&
151 isActivityPubUrlValid(actorJSON.icon.url) 151 isActivityPubUrlValid(actorJSON.icon.url)
152 ) { 152 ) {
153 const extension = AVATAR_MIMETYPE_EXT[actorJSON.icon.mediaType] 153 const extension = IMAGE_MIMETYPE_EXT[actorJSON.icon.mediaType]
154 154
155 const avatarName = uuidv4() + extension 155 const avatarName = uuidv4() + extension
156 const destPath = join(CONFIG.STORAGE.AVATARS_DIR, avatarName) 156 const destPath = join(CONFIG.STORAGE.AVATARS_DIR, avatarName)