]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/commitdiff
Use sensitive instead of nsfw in activitypub
authorChocobozzz <me@florianbigard.com>
Fri, 26 Jan 2018 16:25:35 +0000 (17:25 +0100)
committerChocobozzz <me@florianbigard.com>
Fri, 26 Jan 2018 16:25:35 +0000 (17:25 +0100)
server/helpers/activitypub.ts
server/helpers/custom-validators/activitypub/videos.ts
server/lib/activitypub/videos.ts
server/models/video/video.ts
shared/models/activitypub/objects/video-torrent-object.ts

index a19726beb45692abe5fb7d4ba6f9030e372d6d51..97115680cd129383ed27eaf6cc6a934863a2add3 100644 (file)
@@ -15,7 +15,7 @@ function activityPubContextify <T> (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',
index 5d2a1f1713862b35fadab7b64b008adb88cc15eb..10588423a930bf79c6f65b4a9fc9ed54945aa013 100644 (file)
@@ -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) &&
index 7d535bb0acc2cc31325569cf364cd46e4467f36a..c9c4674d94bf9ce6019bf33dabc5cb21fe6a25f3 100644 (file)
@@ -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),
index bd834b088bbafa28221bcebd643dbdc76aab7663..8e1acdd44e6d17e9385790c8e2f227bc943d5407 100644 (file)
@@ -1027,7 +1027,7 @@ export class VideoModel extends Model<VideoModel> {
       licence,
       language,
       views: this.views,
-      nsfw: this.nsfw,
+      sensitive: this.nsfw,
       commentsEnabled: this.commentsEnabled,
       published: this.createdAt.toISOString(),
       updated: this.updatedAt.toISOString(),
index d3b5f7c263dbc07608576aa055619bcd9f3ee702..6f03bf7d0f8caa9745d8ac9b0760caf8f9418730 100644 (file)
@@ -17,7 +17,7 @@ export interface VideoTorrentObject {
   licence: ActivityIdentifierObject
   language: ActivityIdentifierObject
   views: number
-  nsfw: boolean
+  sensitive: boolean
   commentsEnabled: boolean
   published: string
   updated: string