diff options
author | Chocobozzz <me@florianbigard.com> | 2018-08-07 10:07:53 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2018-08-08 09:30:31 +0200 |
commit | a84b8fa5cf6e4cafb841af3db9bdfcc9531c09a4 (patch) | |
tree | cf2feafcfadb5b6e9784c86d67e692db8d599b7d /server/initializers | |
parent | 990b6a0b0c4fbebc165e5cf7cec8fbc1cbaa6c66 (diff) | |
download | PeerTube-a84b8fa5cf6e4cafb841af3db9bdfcc9531c09a4.tar.gz PeerTube-a84b8fa5cf6e4cafb841af3db9bdfcc9531c09a4.tar.zst PeerTube-a84b8fa5cf6e4cafb841af3db9bdfcc9531c09a4.zip |
Add import.video.torrent configuration
Diffstat (limited to 'server/initializers')
-rw-r--r-- | server/initializers/constants.ts | 5 | ||||
-rw-r--r-- | server/initializers/migrations/0245-import-magnet.ts | 42 |
2 files changed, 4 insertions, 43 deletions
diff --git a/server/initializers/constants.ts b/server/initializers/constants.ts index cf7cd3d74..80eb3f1e7 100644 --- a/server/initializers/constants.ts +++ b/server/initializers/constants.ts | |||
@@ -15,7 +15,7 @@ let config: IConfig = require('config') | |||
15 | 15 | ||
16 | // --------------------------------------------------------------------------- | 16 | // --------------------------------------------------------------------------- |
17 | 17 | ||
18 | const LAST_MIGRATION_VERSION = 245 | 18 | const LAST_MIGRATION_VERSION = 240 |
19 | 19 | ||
20 | // --------------------------------------------------------------------------- | 20 | // --------------------------------------------------------------------------- |
21 | 21 | ||
@@ -211,6 +211,9 @@ const CONFIG = { | |||
211 | VIDEOS: { | 211 | VIDEOS: { |
212 | HTTP: { | 212 | HTTP: { |
213 | get ENABLED () { return config.get<boolean>('import.videos.http.enabled') } | 213 | get ENABLED () { return config.get<boolean>('import.videos.http.enabled') } |
214 | }, | ||
215 | TORRENT: { | ||
216 | get ENABLED () { return config.get<boolean>('import.videos.torrent.enabled') } | ||
214 | } | 217 | } |
215 | } | 218 | } |
216 | }, | 219 | }, |
diff --git a/server/initializers/migrations/0245-import-magnet.ts b/server/initializers/migrations/0245-import-magnet.ts deleted file mode 100644 index 87603b006..000000000 --- a/server/initializers/migrations/0245-import-magnet.ts +++ /dev/null | |||
@@ -1,42 +0,0 @@ | |||
1 | import * as Sequelize from 'sequelize' | ||
2 | import { Migration } from '../../models/migrations' | ||
3 | import { CONSTRAINTS_FIELDS } from '../index' | ||
4 | |||
5 | async function up (utils: { | ||
6 | transaction: Sequelize.Transaction | ||
7 | queryInterface: Sequelize.QueryInterface | ||
8 | sequelize: Sequelize.Sequelize | ||
9 | }): Promise<any> { | ||
10 | { | ||
11 | const data = { | ||
12 | type: Sequelize.STRING, | ||
13 | allowNull: true, | ||
14 | defaultValue: null | ||
15 | } as Migration.String | ||
16 | await utils.queryInterface.changeColumn('videoImport', 'targetUrl', data) | ||
17 | } | ||
18 | |||
19 | { | ||
20 | const data = { | ||
21 | type: Sequelize.STRING(CONSTRAINTS_FIELDS.VIDEO_IMPORTS.URL.max), | ||
22 | allowNull: true, | ||
23 | defaultValue: null | ||
24 | } | ||
25 | await utils.queryInterface.addColumn('videoImport', 'magnetUri', data) | ||
26 | } | ||
27 | |||
28 | { | ||
29 | const data = { | ||
30 | type: Sequelize.STRING(CONSTRAINTS_FIELDS.VIDEO_IMPORTS.TORRENT_NAME.max), | ||
31 | allowNull: true, | ||
32 | defaultValue: null | ||
33 | } | ||
34 | await utils.queryInterface.addColumn('videoImport', 'torrentName', data) | ||
35 | } | ||
36 | } | ||
37 | |||
38 | function down (options) { | ||
39 | throw new Error('Not implemented.') | ||
40 | } | ||
41 | |||
42 | export { up, down } | ||