diff options
author | Chocobozzz <me@florianbigard.com> | 2018-02-13 18:17:05 +0100 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2018-02-14 16:03:09 +0100 |
commit | ac81d1a06d57b9ae86663831e7f5edcef57b0fa4 (patch) | |
tree | da31775c9533d3e270f68f921e146f086bf7c0b8 /server/lib/activitypub | |
parent | e883399fa6caa56bb8519c9a2e22d88001f26661 (diff) | |
download | PeerTube-ac81d1a06d57b9ae86663831e7f5edcef57b0fa4.tar.gz PeerTube-ac81d1a06d57b9ae86663831e7f5edcef57b0fa4.tar.zst PeerTube-ac81d1a06d57b9ae86663831e7f5edcef57b0fa4.zip |
Add ability to set video thumbnail/preview
Diffstat (limited to 'server/lib/activitypub')
-rw-r--r-- | server/lib/activitypub/actor.ts | 6 |
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' | |||
12 | import { createPrivateAndPublicKeys } from '../../helpers/peertube-crypto' | 12 | import { createPrivateAndPublicKeys } from '../../helpers/peertube-crypto' |
13 | import { doRequest, doRequestAndSaveToFile } from '../../helpers/requests' | 13 | import { doRequest, doRequestAndSaveToFile } from '../../helpers/requests' |
14 | import { getUrlFromWebfinger } from '../../helpers/webfinger' | 14 | import { getUrlFromWebfinger } from '../../helpers/webfinger' |
15 | import { AVATAR_MIMETYPE_EXT, CONFIG, sequelizeTypescript } from '../../initializers' | 15 | import { IMAGE_MIMETYPE_EXT, CONFIG, sequelizeTypescript } from '../../initializers' |
16 | import { AccountModel } from '../../models/account/account' | 16 | import { AccountModel } from '../../models/account/account' |
17 | import { ActorModel } from '../../models/activitypub/actor' | 17 | import { ActorModel } from '../../models/activitypub/actor' |
18 | import { AvatarModel } from '../../models/avatar/avatar' | 18 | import { AvatarModel } from '../../models/avatar/avatar' |
@@ -147,10 +147,10 @@ async function fetchActorTotalItems (url: string) { | |||
147 | 147 | ||
148 | async function fetchAvatarIfExists (actorJSON: ActivityPubActor) { | 148 | async 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) |