aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/lib/activitypub
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2020-02-06 17:41:25 +0100
committerChocobozzz <me@florianbigard.com>2020-02-06 17:41:25 +0100
commit58b6fdcafceb086df81d3070d34c4fdf8deb28ad (patch)
treec5f9906c2c4e522f30188ecddfc8a9980f7f5294 /server/lib/activitypub
parent6872996d296d5b8024c569fce426562fac2f64bf (diff)
downloadPeerTube-58b6fdcafceb086df81d3070d34c4fdf8deb28ad.tar.gz
PeerTube-58b6fdcafceb086df81d3070d34c4fdf8deb28ad.tar.zst
PeerTube-58b6fdcafceb086df81d3070d34c4fdf8deb28ad.zip
Small cleanup
Diffstat (limited to 'server/lib/activitypub')
-rw-r--r--server/lib/activitypub/videos.ts25
1 files changed, 12 insertions, 13 deletions
diff --git a/server/lib/activitypub/videos.ts b/server/lib/activitypub/videos.ts
index 7386c2e53..d182ca5a2 100644
--- a/server/lib/activitypub/videos.ts
+++ b/server/lib/activitypub/videos.ts
@@ -626,20 +626,15 @@ function videoActivityObjectToDBAttributes (videoChannel: MChannelId, videoObjec
626 const privacy = to.indexOf(ACTIVITY_PUB.PUBLIC) !== -1 ? VideoPrivacy.PUBLIC : VideoPrivacy.UNLISTED 626 const privacy = to.indexOf(ACTIVITY_PUB.PUBLIC) !== -1 ? VideoPrivacy.PUBLIC : VideoPrivacy.UNLISTED
627 const duration = videoObject.duration.replace(/[^\d]+/, '') 627 const duration = videoObject.duration.replace(/[^\d]+/, '')
628 628
629 let language: string | undefined 629 const language = videoObject.language?.identifier
630 if (videoObject.language) {
631 language = videoObject.language.identifier
632 }
633 630
634 let category: number | undefined 631 const category = videoObject.category
635 if (videoObject.category) { 632 ? parseInt(videoObject.category.identifier, 10)
636 category = parseInt(videoObject.category.identifier, 10) 633 : undefined
637 }
638 634
639 let licence: number | undefined 635 const licence = videoObject.licence
640 if (videoObject.licence) { 636 ? parseInt(videoObject.licence.identifier, 10)
641 licence = parseInt(videoObject.licence.identifier, 10) 637 : undefined
642 }
643 638
644 const description = videoObject.content || null 639 const description = videoObject.content || null
645 const support = videoObject.support || null 640 const support = videoObject.support || null
@@ -662,7 +657,11 @@ function videoActivityObjectToDBAttributes (videoChannel: MChannelId, videoObjec
662 duration: parseInt(duration, 10), 657 duration: parseInt(duration, 10),
663 createdAt: new Date(videoObject.published), 658 createdAt: new Date(videoObject.published),
664 publishedAt: new Date(videoObject.published), 659 publishedAt: new Date(videoObject.published),
665 originallyPublishedAt: videoObject.originallyPublishedAt ? new Date(videoObject.originallyPublishedAt) : null, 660
661 originallyPublishedAt: videoObject.originallyPublishedAt
662 ? new Date(videoObject.originallyPublishedAt)
663 : null,
664
666 updatedAt: new Date(videoObject.updated), 665 updatedAt: new Date(videoObject.updated),
667 views: videoObject.views, 666 views: videoObject.views,
668 likes: 0, 667 likes: 0,