Fix AP icon URL for imported videos
authorChocobozzz <me@florianbigard.com>
Wed, 29 Jan 2020 13:41:42 +0000 (14:41 +0100)
committerChocobozzz <me@florianbigard.com>
Wed, 29 Jan 2020 13:41:42 +0000 (14:41 +0100)
server/models/video/thumbnail.ts
server/models/video/video-format-utils.ts

index e68a6711fe637aa996cc6f512fae174a0c0cb0fb..3b011b1d285de4fb1caf5e44f4f5a2a020b377ed 100644 (file)
@@ -126,8 +126,8 @@ export class ThumbnailModel extends Model<ThumbnailModel> {
     return videoUUID + '.jpg'
   }
 
-  getFileUrl () {
-    if (this.fileUrl) return this.fileUrl
+  getFileUrl (isLocal: boolean) {
+    if (isLocal === false) return this.fileUrl
 
     const staticPath = ThumbnailModel.types[this.type].staticPath
     return WEBSERVER.URL + staticPath + this.filename
index 9fed2d49da8b2b1ece13d75a02f52216fe32f7ee..2aa5b8677cfffc42be08282e5719f47692958f60 100644 (file)
@@ -338,7 +338,7 @@ function videoModelToActivityPubObject (video: MVideoAP): VideoTorrentObject {
     subtitleLanguage,
     icon: {
       type: 'Image',
-      url: miniature.getFileUrl(),
+      url: miniature.getFileUrl(video.isOwned()),
       mediaType: 'image/jpeg',
       width: miniature.width,
       height: miniature.height