From 0a67e28beeaf603110d52df3eda400e60531b3a4 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Fri, 26 Jan 2018 17:25:35 +0100 Subject: [PATCH] Use sensitive instead of nsfw in activitypub --- server/helpers/activitypub.ts | 2 +- server/helpers/custom-validators/activitypub/videos.ts | 2 +- server/lib/activitypub/videos.ts | 2 +- server/models/video/video.ts | 2 +- shared/models/activitypub/objects/video-torrent-object.ts | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/server/helpers/activitypub.ts b/server/helpers/activitypub.ts index a19726beb..97115680c 100644 --- a/server/helpers/activitypub.ts +++ b/server/helpers/activitypub.ts @@ -15,7 +15,7 @@ function activityPubContextify (data: T) { 'uuid': 'http://schema.org/identifier', 'category': 'http://schema.org/category', 'licence': 'http://schema.org/license', - 'nsfw': 'as:sensitive', + 'sensitive': 'as:sensitive', 'language': 'http://schema.org/inLanguage', 'views': 'http://schema.org/Number', 'size': 'http://schema.org/Number', diff --git a/server/helpers/custom-validators/activitypub/videos.ts b/server/helpers/custom-validators/activitypub/videos.ts index 5d2a1f171..10588423a 100644 --- a/server/helpers/custom-validators/activitypub/videos.ts +++ b/server/helpers/custom-validators/activitypub/videos.ts @@ -52,7 +52,7 @@ function isVideoTorrentObjectValid (video: any) { (!video.licence || isRemoteIdentifierValid(video.licence)) && (!video.language || isRemoteIdentifierValid(video.language)) && isVideoViewsValid(video.views) && - isBooleanValid(video.nsfw) && + isBooleanValid(video.sensitive) && isBooleanValid(video.commentsEnabled) && isDateValid(video.published) && isDateValid(video.updated) && diff --git a/server/lib/activitypub/videos.ts b/server/lib/activitypub/videos.ts index 7d535bb0a..c9c4674d9 100644 --- a/server/lib/activitypub/videos.ts +++ b/server/lib/activitypub/videos.ts @@ -91,7 +91,7 @@ async function videoActivityObjectToDBAttributes (videoChannel: VideoChannelMode licence, language, description, - nsfw: videoObject.nsfw, + nsfw: videoObject.sensitive, commentsEnabled: videoObject.commentsEnabled, channelId: videoChannel.id, duration: parseInt(duration, 10), diff --git a/server/models/video/video.ts b/server/models/video/video.ts index bd834b088..8e1acdd44 100644 --- a/server/models/video/video.ts +++ b/server/models/video/video.ts @@ -1027,7 +1027,7 @@ export class VideoModel extends Model { licence, language, views: this.views, - nsfw: this.nsfw, + sensitive: this.nsfw, commentsEnabled: this.commentsEnabled, published: this.createdAt.toISOString(), updated: this.updatedAt.toISOString(), diff --git a/shared/models/activitypub/objects/video-torrent-object.ts b/shared/models/activitypub/objects/video-torrent-object.ts index d3b5f7c26..6f03bf7d0 100644 --- a/shared/models/activitypub/objects/video-torrent-object.ts +++ b/shared/models/activitypub/objects/video-torrent-object.ts @@ -17,7 +17,7 @@ export interface VideoTorrentObject { licence: ActivityIdentifierObject language: ActivityIdentifierObject views: number - nsfw: boolean + sensitive: boolean commentsEnabled: boolean published: string updated: string -- 2.25.1