diff options
Diffstat (limited to 'server/lib/activitypub/videos/shared/object-to-model-attributes.ts')
-rw-r--r-- | server/lib/activitypub/videos/shared/object-to-model-attributes.ts | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/server/lib/activitypub/videos/shared/object-to-model-attributes.ts b/server/lib/activitypub/videos/shared/object-to-model-attributes.ts index c97217669..f02b9cba6 100644 --- a/server/lib/activitypub/videos/shared/object-to-model-attributes.ts +++ b/server/lib/activitypub/videos/shared/object-to-model-attributes.ts | |||
@@ -24,6 +24,7 @@ import { | |||
24 | VideoPrivacy, | 24 | VideoPrivacy, |
25 | VideoStreamingPlaylistType | 25 | VideoStreamingPlaylistType |
26 | } from '@shared/models' | 26 | } from '@shared/models' |
27 | import { getDurationFromActivityStream } from '../../activity' | ||
27 | 28 | ||
28 | function getThumbnailFromIcons (videoObject: VideoObject) { | 29 | function getThumbnailFromIcons (videoObject: VideoObject) { |
29 | let validIcons = videoObject.icon.filter(i => i.width > THUMBNAILS_SIZE.minWidth) | 30 | let validIcons = videoObject.icon.filter(i => i.width > THUMBNAILS_SIZE.minWidth) |
@@ -170,7 +171,6 @@ function getVideoAttributesFromObject (videoChannel: MChannelId, videoObject: Vi | |||
170 | ? VideoPrivacy.PUBLIC | 171 | ? VideoPrivacy.PUBLIC |
171 | : VideoPrivacy.UNLISTED | 172 | : VideoPrivacy.UNLISTED |
172 | 173 | ||
173 | const duration = videoObject.duration.replace(/[^\d]+/, '') | ||
174 | const language = videoObject.language?.identifier | 174 | const language = videoObject.language?.identifier |
175 | 175 | ||
176 | const category = videoObject.category | 176 | const category = videoObject.category |
@@ -200,7 +200,7 @@ function getVideoAttributesFromObject (videoChannel: MChannelId, videoObject: Vi | |||
200 | isLive: videoObject.isLiveBroadcast, | 200 | isLive: videoObject.isLiveBroadcast, |
201 | state: videoObject.state, | 201 | state: videoObject.state, |
202 | channelId: videoChannel.id, | 202 | channelId: videoChannel.id, |
203 | duration: parseInt(duration, 10), | 203 | duration: getDurationFromActivityStream(videoObject.duration), |
204 | createdAt: new Date(videoObject.published), | 204 | createdAt: new Date(videoObject.published), |
205 | publishedAt: new Date(videoObject.published), | 205 | publishedAt: new Date(videoObject.published), |
206 | 206 | ||