]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/initializers/constants.js
Format video blacklist
[github/Chocobozzz/PeerTube.git] / server / initializers / constants.js
index 2d5bb84cc66bc417c019b2e79ca94faccc271d9e..d6da20982b29a0eded0e0c70dfebda862db334dd 100644 (file)
@@ -5,7 +5,7 @@ const path = require('path')
 
 // ---------------------------------------------------------------------------
 
-const LAST_MIGRATION_VERSION = 15
+const LAST_MIGRATION_VERSION = 50
 
 // ---------------------------------------------------------------------------
 
@@ -24,7 +24,7 @@ const SEARCHABLE_COLUMNS = {
 const SORTABLE_COLUMNS = {
   USERS: [ 'id', 'username', 'createdAt' ],
   VIDEO_ABUSES: [ 'id', 'createdAt' ],
-  VIDEOS: [ 'name', 'duration', 'createdAt', 'views' ]
+  VIDEOS: [ 'name', 'duration', 'createdAt', 'views', 'likes' ]
 }
 
 const OAUTH_LIFETIME = {
@@ -61,6 +61,9 @@ const CONFIG = {
   },
   ADMIN: {
     EMAIL: config.get('admin.email')
+  },
+  SIGNUP: {
+    ENABLED: config.get('signup.enabled')
   }
 }
 CONFIG.WEBSERVER.URL = CONFIG.WEBSERVER.SCHEME + '://' + CONFIG.WEBSERVER.HOSTNAME + ':' + CONFIG.WEBSERVER.PORT
@@ -82,7 +85,7 @@ const CONSTRAINTS_FIELDS = {
     EXTNAME: [ '.mp4', '.ogv', '.webm' ],
     INFO_HASH: { min: 40, max: 40 }, // Length, infohash is 20 bytes length but we represent it in hexa so 20 * 2
     DURATION: { min: 1, max: 7200 }, // Number
-    TAGS: { min: 1, max: 3 }, // Number of total tags
+    TAGS: { min: 0, max: 3 }, // Number of total tags
     TAG: { min: 2, max: 10 }, // Length
     THUMBNAIL: { min: 2, max: 30 },
     THUMBNAIL_DATA: { min: 0, max: 20000 }, // Bytes
@@ -95,6 +98,61 @@ const CONSTRAINTS_FIELDS = {
   }
 }
 
+const VIDEO_RATE_TYPES = {
+  LIKE: 'like',
+  DISLIKE: 'dislike'
+}
+
+const VIDEO_CATEGORIES = {
+  1: 'Music',
+  2: 'Films',
+  3: 'Vehicles',
+  4: 'Art',
+  5: 'Sports',
+  6: 'Travels',
+  7: 'Gaming',
+  8: 'People',
+  9: 'Comedy',
+  10: 'Entertainment',
+  11: 'News',
+  12: 'Howto',
+  13: 'Education',
+  14: 'Activism',
+  15: 'Science & Technology',
+  16: 'Animals',
+  17: 'Kids',
+  18: 'Food'
+}
+
+// See https://creativecommons.org/licenses/?lang=en
+const VIDEO_LICENCES = {
+  1: 'Attribution',
+  2: 'Attribution - Share Alike',
+  3: 'Attribution - No Derivatives',
+  4: 'Attribution - Non Commercial',
+  5: 'Attribution - Non Commercial - Share Alike',
+  6: 'Attribution - Non Commercial - No Derivatives',
+  7: 'Public Domain Dedication'
+}
+
+// See https://en.wikipedia.org/wiki/List_of_languages_by_number_of_native_speakers#Nationalencyklopedin
+const VIDEO_LANGUAGES = {
+  1: 'English',
+  2: 'Spanish',
+  3: 'Mandarin',
+  4: 'Hindi',
+  5: 'Arabic',
+  6: 'Portuguese',
+  7: 'Bengali',
+  8: 'Russian',
+  9: 'Japanese',
+  10: 'Punjabi',
+  11: 'German',
+  12: 'Korean',
+  13: 'French',
+  14: 'Italien'
+}
+
 // ---------------------------------------------------------------------------
 
 // Score a pod has when we create it as a friend
@@ -249,7 +307,11 @@ module.exports = {
   STATIC_MAX_AGE,
   STATIC_PATHS,
   THUMBNAILS_SIZE,
-  USER_ROLES
+  USER_ROLES,
+  VIDEO_CATEGORIES,
+  VIDEO_LANGUAGES,
+  VIDEO_LICENCES,
+  VIDEO_RATE_TYPES
 }
 
 // ---------------------------------------------------------------------------