1
0
Fork 0
mirror of https://github.com/Chocobozzz/PeerTube.git synced 2025-10-04 18:29:27 +02:00

add webtorrent opt-out settings

- add a key in localstorage to remember the opt-out
- add a user setting
This commit is contained in:
Rigel Kent 2018-10-05 15:17:34 +02:00
parent 0e5ff97f6f
commit 64cc5e8575
No known key found for this signature in database
GPG key ID: EA12971B0E438F36
13 changed files with 97 additions and 6 deletions

View file

@ -7,6 +7,7 @@ import { VideoAbuseState, VideoImportState, VideoPrivacy, VideoTranscodingFPS }
// Do not use barrels, remain constants as independent as possible
import { buildPath, isTestInstance, parseDuration, parseBytes, root, sanitizeHost, sanitizeUrl } from '../helpers/core-utils'
import { NSFWPolicyType } from '../../shared/models/videos/nsfw-policy.type'
import { WebTorrentPolicyType } from '../../shared/models/users/user-webtorrent-policy.type'
import { invert } from 'lodash'
import { CronRepeatOptions, EveryRepeatOptions } from 'bull'
import * as bytes from 'bytes'
@ -16,7 +17,7 @@ let config: IConfig = require('config')
// ---------------------------------------------------------------------------
const LAST_MIGRATION_VERSION = 275
const LAST_MIGRATION_VERSION = 280
// ---------------------------------------------------------------------------
@ -546,6 +547,12 @@ const NSFW_POLICY_TYPES: { [ id: string]: NSFWPolicyType } = {
DISPLAY: 'display'
}
const WEBTORRENT_POLICY_TYPES: { [ id: string]: WebTorrentPolicyType } = {
ENABLE: 'enable',
DISABLE: 'disable',
DISABLE_ON_MOBILE: 'disable_on_mobile'
}
// ---------------------------------------------------------------------------
// Express static paths (router)
@ -698,6 +705,7 @@ export {
FEEDS,
JOB_TTL,
NSFW_POLICY_TYPES,
WEBTORRENT_POLICY_TYPES,
TORRENT_MIMETYPE_EXT,
STATIC_MAX_AGE,
STATIC_PATHS,