diff options
author | Chocobozzz <me@florianbigard.com> | 2019-04-11 11:33:44 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2019-04-11 13:45:39 +0200 |
commit | 6dd9de95dfa39bd5c1faed00d1dbd52cd112bae0 (patch) | |
tree | b47de7efb8c6c611c63a15a971c6125a278f547a /server/models | |
parent | 2c3abc4fa796555eb7d25f416c4f41ab3e3ad8ca (diff) | |
download | PeerTube-6dd9de95dfa39bd5c1faed00d1dbd52cd112bae0.tar.gz PeerTube-6dd9de95dfa39bd5c1faed00d1dbd52cd112bae0.tar.zst PeerTube-6dd9de95dfa39bd5c1faed00d1dbd52cd112bae0.zip |
Move config in its own file
Diffstat (limited to 'server/models')
-rw-r--r-- | server/models/account/account.ts | 4 | ||||
-rw-r--r-- | server/models/activitypub/actor.ts | 6 | ||||
-rw-r--r-- | server/models/avatar/avatar.ts | 3 | ||||
-rw-r--r-- | server/models/redundancy/video-redundancy.ts | 3 | ||||
-rw-r--r-- | server/models/video/video-caption.ts | 3 | ||||
-rw-r--r-- | server/models/video/video-channel.ts | 7 | ||||
-rw-r--r-- | server/models/video/video-comment.ts | 4 | ||||
-rw-r--r-- | server/models/video/video-format-utils.ts | 4 | ||||
-rw-r--r-- | server/models/video/video-playlist.ts | 7 | ||||
-rw-r--r-- | server/models/video/video.ts | 22 |
10 files changed, 35 insertions, 28 deletions
diff --git a/server/models/account/account.ts b/server/models/account/account.ts index 7cc40f631..6f425024e 100644 --- a/server/models/account/account.ts +++ b/server/models/account/account.ts | |||
@@ -25,9 +25,9 @@ import { getSort, throwIfNotValid } from '../utils' | |||
25 | import { VideoChannelModel } from '../video/video-channel' | 25 | import { VideoChannelModel } from '../video/video-channel' |
26 | import { VideoCommentModel } from '../video/video-comment' | 26 | import { VideoCommentModel } from '../video/video-comment' |
27 | import { UserModel } from './user' | 27 | import { UserModel } from './user' |
28 | import { CONFIG } from '../../initializers' | ||
29 | import { AvatarModel } from '../avatar/avatar' | 28 | import { AvatarModel } from '../avatar/avatar' |
30 | import { VideoPlaylistModel } from '../video/video-playlist' | 29 | import { VideoPlaylistModel } from '../video/video-playlist' |
30 | import { WEBSERVER } from '../../initializers/constants' | ||
31 | 31 | ||
32 | export enum ScopeNames { | 32 | export enum ScopeNames { |
33 | SUMMARY = 'SUMMARY' | 33 | SUMMARY = 'SUMMARY' |
@@ -199,7 +199,7 @@ export class AccountModel extends Model<AccountModel> { | |||
199 | static loadByNameWithHost (nameWithHost: string) { | 199 | static loadByNameWithHost (nameWithHost: string) { |
200 | const [ accountName, host ] = nameWithHost.split('@') | 200 | const [ accountName, host ] = nameWithHost.split('@') |
201 | 201 | ||
202 | if (!host || host === CONFIG.WEBSERVER.HOST) return AccountModel.loadLocalByName(accountName) | 202 | if (!host || host === WEBSERVER.HOST) return AccountModel.loadLocalByName(accountName) |
203 | 203 | ||
204 | return AccountModel.loadByNameAndHost(accountName, host) | 204 | return AccountModel.loadByNameAndHost(accountName, host) |
205 | } | 205 | } |
diff --git a/server/models/activitypub/actor.ts b/server/models/activitypub/actor.ts index 7d91e8a4a..5472c8b92 100644 --- a/server/models/activitypub/actor.ts +++ b/server/models/activitypub/actor.ts | |||
@@ -30,7 +30,7 @@ import { | |||
30 | isActorPublicKeyValid | 30 | isActorPublicKeyValid |
31 | } from '../../helpers/custom-validators/activitypub/actor' | 31 | } from '../../helpers/custom-validators/activitypub/actor' |
32 | import { isActivityPubUrlValid } from '../../helpers/custom-validators/activitypub/misc' | 32 | import { isActivityPubUrlValid } from '../../helpers/custom-validators/activitypub/misc' |
33 | import { ACTIVITY_PUB, ACTIVITY_PUB_ACTOR_TYPES, CONFIG, CONSTRAINTS_FIELDS } from '../../initializers' | 33 | import { ACTIVITY_PUB, ACTIVITY_PUB_ACTOR_TYPES, CONSTRAINTS_FIELDS, WEBSERVER } from '../../initializers' |
34 | import { AccountModel } from '../account/account' | 34 | import { AccountModel } from '../account/account' |
35 | import { AvatarModel } from '../avatar/avatar' | 35 | import { AvatarModel } from '../avatar/avatar' |
36 | import { ServerModel } from '../server/server' | 36 | import { ServerModel } from '../server/server' |
@@ -516,7 +516,7 @@ export class ActorModel extends Model<ActorModel> { | |||
516 | } | 516 | } |
517 | 517 | ||
518 | getHost () { | 518 | getHost () { |
519 | return this.Server ? this.Server.host : CONFIG.WEBSERVER.HOST | 519 | return this.Server ? this.Server.host : WEBSERVER.HOST |
520 | } | 520 | } |
521 | 521 | ||
522 | getRedundancyAllowed () { | 522 | getRedundancyAllowed () { |
@@ -526,7 +526,7 @@ export class ActorModel extends Model<ActorModel> { | |||
526 | getAvatarUrl () { | 526 | getAvatarUrl () { |
527 | if (!this.avatarId) return undefined | 527 | if (!this.avatarId) return undefined |
528 | 528 | ||
529 | return CONFIG.WEBSERVER.URL + this.Avatar.getWebserverPath() | 529 | return WEBSERVER.URL + this.Avatar.getWebserverPath() |
530 | } | 530 | } |
531 | 531 | ||
532 | isOutdated () { | 532 | isOutdated () { |
diff --git a/server/models/avatar/avatar.ts b/server/models/avatar/avatar.ts index 303aebcc2..455835524 100644 --- a/server/models/avatar/avatar.ts +++ b/server/models/avatar/avatar.ts | |||
@@ -1,9 +1,10 @@ | |||
1 | import { join } from 'path' | 1 | import { join } from 'path' |
2 | import { AfterDestroy, AllowNull, Column, CreatedAt, Model, Table, UpdatedAt } from 'sequelize-typescript' | 2 | import { AfterDestroy, AllowNull, Column, CreatedAt, Model, Table, UpdatedAt } from 'sequelize-typescript' |
3 | import { Avatar } from '../../../shared/models/avatars/avatar.model' | 3 | import { Avatar } from '../../../shared/models/avatars/avatar.model' |
4 | import { CONFIG, STATIC_PATHS } from '../../initializers' | 4 | import { STATIC_PATHS } from '../../initializers' |
5 | import { logger } from '../../helpers/logger' | 5 | import { logger } from '../../helpers/logger' |
6 | import { remove } from 'fs-extra' | 6 | import { remove } from 'fs-extra' |
7 | import { CONFIG } from '../../initializers/config' | ||
7 | 8 | ||
8 | @Table({ | 9 | @Table({ |
9 | tableName: 'avatar' | 10 | tableName: 'avatar' |
diff --git a/server/models/redundancy/video-redundancy.ts b/server/models/redundancy/video-redundancy.ts index b722bed14..39c50be5c 100644 --- a/server/models/redundancy/video-redundancy.ts +++ b/server/models/redundancy/video-redundancy.ts | |||
@@ -15,7 +15,7 @@ import { | |||
15 | import { ActorModel } from '../activitypub/actor' | 15 | import { ActorModel } from '../activitypub/actor' |
16 | import { getVideoSort, throwIfNotValid } from '../utils' | 16 | import { getVideoSort, throwIfNotValid } from '../utils' |
17 | import { isActivityPubUrlValid, isUrlValid } from '../../helpers/custom-validators/activitypub/misc' | 17 | import { isActivityPubUrlValid, isUrlValid } from '../../helpers/custom-validators/activitypub/misc' |
18 | import { CONFIG, CONSTRAINTS_FIELDS, MIMETYPES } from '../../initializers' | 18 | import { CONSTRAINTS_FIELDS, MIMETYPES } from '../../initializers' |
19 | import { VideoFileModel } from '../video/video-file' | 19 | import { VideoFileModel } from '../video/video-file' |
20 | import { getServerActor } from '../../helpers/utils' | 20 | import { getServerActor } from '../../helpers/utils' |
21 | import { VideoModel } from '../video/video' | 21 | import { VideoModel } from '../video/video' |
@@ -29,6 +29,7 @@ import { isTestInstance } from '../../helpers/core-utils' | |||
29 | import * as Bluebird from 'bluebird' | 29 | import * as Bluebird from 'bluebird' |
30 | import * as Sequelize from 'sequelize' | 30 | import * as Sequelize from 'sequelize' |
31 | import { VideoStreamingPlaylistModel } from '../video/video-streaming-playlist' | 31 | import { VideoStreamingPlaylistModel } from '../video/video-streaming-playlist' |
32 | import { CONFIG } from '../../initializers/config' | ||
32 | 33 | ||
33 | export enum ScopeNames { | 34 | export enum ScopeNames { |
34 | WITH_VIDEO = 'WITH_VIDEO' | 35 | WITH_VIDEO = 'WITH_VIDEO' |
diff --git a/server/models/video/video-caption.ts b/server/models/video/video-caption.ts index b4f17b481..c670bce71 100644 --- a/server/models/video/video-caption.ts +++ b/server/models/video/video-caption.ts | |||
@@ -16,10 +16,11 @@ import { throwIfNotValid } from '../utils' | |||
16 | import { VideoModel } from './video' | 16 | import { VideoModel } from './video' |
17 | import { isVideoCaptionLanguageValid } from '../../helpers/custom-validators/video-captions' | 17 | import { isVideoCaptionLanguageValid } from '../../helpers/custom-validators/video-captions' |
18 | import { VideoCaption } from '../../../shared/models/videos/caption/video-caption.model' | 18 | import { VideoCaption } from '../../../shared/models/videos/caption/video-caption.model' |
19 | import { CONFIG, STATIC_PATHS, VIDEO_LANGUAGES } from '../../initializers' | 19 | import { STATIC_PATHS, VIDEO_LANGUAGES } from '../../initializers' |
20 | import { join } from 'path' | 20 | import { join } from 'path' |
21 | import { logger } from '../../helpers/logger' | 21 | import { logger } from '../../helpers/logger' |
22 | import { remove } from 'fs-extra' | 22 | import { remove } from 'fs-extra' |
23 | import { CONFIG } from '../../initializers/config' | ||
23 | 24 | ||
24 | export enum ScopeNames { | 25 | export enum ScopeNames { |
25 | WITH_VIDEO_UUID_AND_REMOTE = 'WITH_VIDEO_UUID_AND_REMOTE' | 26 | WITH_VIDEO_UUID_AND_REMOTE = 'WITH_VIDEO_UUID_AND_REMOTE' |
diff --git a/server/models/video/video-channel.ts b/server/models/video/video-channel.ts index ca06048d1..1abc23eaa 100644 --- a/server/models/video/video-channel.ts +++ b/server/models/video/video-channel.ts | |||
@@ -8,7 +8,8 @@ import { | |||
8 | Default, | 8 | Default, |
9 | DefaultScope, | 9 | DefaultScope, |
10 | ForeignKey, | 10 | ForeignKey, |
11 | HasMany, IFindOptions, | 11 | HasMany, |
12 | IFindOptions, | ||
12 | Is, | 13 | Is, |
13 | Model, | 14 | Model, |
14 | Scopes, | 15 | Scopes, |
@@ -28,7 +29,7 @@ import { AccountModel, ScopeNames as AccountModelScopeNames } from '../account/a | |||
28 | import { ActorModel, unusedActorAttributesForAPI } from '../activitypub/actor' | 29 | import { ActorModel, unusedActorAttributesForAPI } from '../activitypub/actor' |
29 | import { buildServerIdsFollowedBy, buildTrigramSearchIndex, createSimilarityAttribute, getSort, throwIfNotValid } from '../utils' | 30 | import { buildServerIdsFollowedBy, buildTrigramSearchIndex, createSimilarityAttribute, getSort, throwIfNotValid } from '../utils' |
30 | import { VideoModel } from './video' | 31 | import { VideoModel } from './video' |
31 | import { CONFIG, CONSTRAINTS_FIELDS } from '../../initializers' | 32 | import { CONSTRAINTS_FIELDS, WEBSERVER } from '../../initializers' |
32 | import { ServerModel } from '../server/server' | 33 | import { ServerModel } from '../server/server' |
33 | import { DefineIndexesOptions } from 'sequelize' | 34 | import { DefineIndexesOptions } from 'sequelize' |
34 | import { AvatarModel } from '../avatar/avatar' | 35 | import { AvatarModel } from '../avatar/avatar' |
@@ -419,7 +420,7 @@ export class VideoChannelModel extends Model<VideoChannelModel> { | |||
419 | static loadByNameWithHostAndPopulateAccount (nameWithHost: string) { | 420 | static loadByNameWithHostAndPopulateAccount (nameWithHost: string) { |
420 | const [ name, host ] = nameWithHost.split('@') | 421 | const [ name, host ] = nameWithHost.split('@') |
421 | 422 | ||
422 | if (!host || host === CONFIG.WEBSERVER.HOST) return VideoChannelModel.loadLocalByNameAndPopulateAccount(name) | 423 | if (!host || host === WEBSERVER.HOST) return VideoChannelModel.loadLocalByNameAndPopulateAccount(name) |
423 | 424 | ||
424 | return VideoChannelModel.loadByNameAndHostAndPopulateAccount(name, host) | 425 | return VideoChannelModel.loadByNameAndHostAndPopulateAccount(name, host) |
425 | } | 426 | } |
diff --git a/server/models/video/video-comment.ts b/server/models/video/video-comment.ts index 93d84c6fc..47f1cbb99 100644 --- a/server/models/video/video-comment.ts +++ b/server/models/video/video-comment.ts | |||
@@ -18,7 +18,7 @@ import { ActivityTagObject } from '../../../shared/models/activitypub/objects/co | |||
18 | import { VideoCommentObject } from '../../../shared/models/activitypub/objects/video-comment-object' | 18 | import { VideoCommentObject } from '../../../shared/models/activitypub/objects/video-comment-object' |
19 | import { VideoComment } from '../../../shared/models/videos/video-comment.model' | 19 | import { VideoComment } from '../../../shared/models/videos/video-comment.model' |
20 | import { isActivityPubUrlValid } from '../../helpers/custom-validators/activitypub/misc' | 20 | import { isActivityPubUrlValid } from '../../helpers/custom-validators/activitypub/misc' |
21 | import { CONFIG, CONSTRAINTS_FIELDS } from '../../initializers' | 21 | import { CONSTRAINTS_FIELDS, WEBSERVER } from '../../initializers' |
22 | import { sendDeleteVideoComment } from '../../lib/activitypub/send' | 22 | import { sendDeleteVideoComment } from '../../lib/activitypub/send' |
23 | import { AccountModel } from '../account/account' | 23 | import { AccountModel } from '../account/account' |
24 | import { ActorModel } from '../activitypub/actor' | 24 | import { ActorModel } from '../activitypub/actor' |
@@ -482,7 +482,7 @@ export class VideoCommentModel extends Model<VideoCommentModel> { | |||
482 | let result: string[] = [] | 482 | let result: string[] = [] |
483 | 483 | ||
484 | const localMention = `@(${actorNameAlphabet}+)` | 484 | const localMention = `@(${actorNameAlphabet}+)` |
485 | const remoteMention = `${localMention}@${CONFIG.WEBSERVER.HOST}` | 485 | const remoteMention = `${localMention}@${WEBSERVER.HOST}` |
486 | 486 | ||
487 | const mentionRegex = this.isOwned() | 487 | const mentionRegex = this.isOwned() |
488 | ? '(?:(?:' + remoteMention + ')|(?:' + localMention + '))' // Include local mentions? | 488 | ? '(?:(?:' + remoteMention + ')|(?:' + localMention + '))' // Include local mentions? |
diff --git a/server/models/video/video-format-utils.ts b/server/models/video/video-format-utils.ts index dc10fb9a2..7915fc1f9 100644 --- a/server/models/video/video-format-utils.ts +++ b/server/models/video/video-format-utils.ts | |||
@@ -7,7 +7,7 @@ import { | |||
7 | ActivityUrlObject, | 7 | ActivityUrlObject, |
8 | VideoTorrentObject | 8 | VideoTorrentObject |
9 | } from '../../../shared/models/activitypub/objects' | 9 | } from '../../../shared/models/activitypub/objects' |
10 | import { CONFIG, MIMETYPES, THUMBNAILS_SIZE } from '../../initializers' | 10 | import { MIMETYPES, THUMBNAILS_SIZE, WEBSERVER } from '../../initializers' |
11 | import { VideoCaptionModel } from './video-caption' | 11 | import { VideoCaptionModel } from './video-caption' |
12 | import { | 12 | import { |
13 | getVideoCommentsActivityPubUrl, | 13 | getVideoCommentsActivityPubUrl, |
@@ -290,7 +290,7 @@ function videoModelToActivityPubObject (video: VideoModel): VideoTorrentObject { | |||
290 | type: 'Link', | 290 | type: 'Link', |
291 | mimeType: 'text/html', | 291 | mimeType: 'text/html', |
292 | mediaType: 'text/html', | 292 | mediaType: 'text/html', |
293 | href: CONFIG.WEBSERVER.URL + '/videos/watch/' + video.uuid | 293 | href: WEBSERVER.URL + '/videos/watch/' + video.uuid |
294 | }) | 294 | }) |
295 | 295 | ||
296 | const subtitleLanguage = [] | 296 | const subtitleLanguage = [] |
diff --git a/server/models/video/video-playlist.ts b/server/models/video/video-playlist.ts index 08e4d32c8..93f36a9d0 100644 --- a/server/models/video/video-playlist.ts +++ b/server/models/video/video-playlist.ts | |||
@@ -26,12 +26,12 @@ import { | |||
26 | import { isActivityPubUrlValid } from '../../helpers/custom-validators/activitypub/misc' | 26 | import { isActivityPubUrlValid } from '../../helpers/custom-validators/activitypub/misc' |
27 | import { | 27 | import { |
28 | ACTIVITY_PUB, | 28 | ACTIVITY_PUB, |
29 | CONFIG, | ||
30 | CONSTRAINTS_FIELDS, | 29 | CONSTRAINTS_FIELDS, |
31 | STATIC_PATHS, | 30 | STATIC_PATHS, |
32 | THUMBNAILS_SIZE, | 31 | THUMBNAILS_SIZE, |
33 | VIDEO_PLAYLIST_PRIVACIES, | 32 | VIDEO_PLAYLIST_PRIVACIES, |
34 | VIDEO_PLAYLIST_TYPES | 33 | VIDEO_PLAYLIST_TYPES, |
34 | WEBSERVER | ||
35 | } from '../../initializers' | 35 | } from '../../initializers' |
36 | import { VideoPlaylist } from '../../../shared/models/videos/playlist/video-playlist.model' | 36 | import { VideoPlaylist } from '../../../shared/models/videos/playlist/video-playlist.model' |
37 | import { AccountModel, ScopeNames as AccountScopeNames } from '../account/account' | 37 | import { AccountModel, ScopeNames as AccountScopeNames } from '../account/account' |
@@ -43,6 +43,7 @@ import { activityPubCollectionPagination } from '../../helpers/activitypub' | |||
43 | import { remove } from 'fs-extra' | 43 | import { remove } from 'fs-extra' |
44 | import { logger } from '../../helpers/logger' | 44 | import { logger } from '../../helpers/logger' |
45 | import { VideoPlaylistType } from '../../../shared/models/videos/playlist/video-playlist-type.model' | 45 | import { VideoPlaylistType } from '../../../shared/models/videos/playlist/video-playlist-type.model' |
46 | import { CONFIG } from '../../initializers/config' | ||
46 | 47 | ||
47 | enum ScopeNames { | 48 | enum ScopeNames { |
48 | AVAILABLE_FOR_LIST = 'AVAILABLE_FOR_LIST', | 49 | AVAILABLE_FOR_LIST = 'AVAILABLE_FOR_LIST', |
@@ -417,7 +418,7 @@ export class VideoPlaylistModel extends Model<VideoPlaylistModel> { | |||
417 | } | 418 | } |
418 | 419 | ||
419 | getThumbnailUrl () { | 420 | getThumbnailUrl () { |
420 | return CONFIG.WEBSERVER.URL + STATIC_PATHS.THUMBNAILS + this.getThumbnailName() | 421 | return WEBSERVER.URL + STATIC_PATHS.THUMBNAILS + this.getThumbnailName() |
421 | } | 422 | } |
422 | 423 | ||
423 | getThumbnailStaticPath () { | 424 | getThumbnailStaticPath () { |
diff --git a/server/models/video/video.ts b/server/models/video/video.ts index b0d92b674..3b30e9e28 100644 --- a/server/models/video/video.ts +++ b/server/models/video/video.ts | |||
@@ -51,10 +51,9 @@ import { getServerActor } from '../../helpers/utils' | |||
51 | import { | 51 | import { |
52 | ACTIVITY_PUB, | 52 | ACTIVITY_PUB, |
53 | API_VERSION, | 53 | API_VERSION, |
54 | CONFIG, | ||
55 | CONSTRAINTS_FIELDS, | 54 | CONSTRAINTS_FIELDS, |
56 | HLS_STREAMING_PLAYLIST_DIRECTORY, | ||
57 | HLS_REDUNDANCY_DIRECTORY, | 55 | HLS_REDUNDANCY_DIRECTORY, |
56 | HLS_STREAMING_PLAYLIST_DIRECTORY, | ||
58 | PREVIEWS_SIZE, | 57 | PREVIEWS_SIZE, |
59 | REMOTE_SCHEME, | 58 | REMOTE_SCHEME, |
60 | STATIC_DOWNLOAD_PATHS, | 59 | STATIC_DOWNLOAD_PATHS, |
@@ -64,7 +63,8 @@ import { | |||
64 | VIDEO_LANGUAGES, | 63 | VIDEO_LANGUAGES, |
65 | VIDEO_LICENCES, | 64 | VIDEO_LICENCES, |
66 | VIDEO_PRIVACIES, | 65 | VIDEO_PRIVACIES, |
67 | VIDEO_STATES | 66 | VIDEO_STATES, |
67 | WEBSERVER | ||
68 | } from '../../initializers' | 68 | } from '../../initializers' |
69 | import { sendDeleteVideo } from '../../lib/activitypub/send' | 69 | import { sendDeleteVideo } from '../../lib/activitypub/send' |
70 | import { AccountModel } from '../account/account' | 70 | import { AccountModel } from '../account/account' |
@@ -77,12 +77,13 @@ import { | |||
77 | buildTrigramSearchIndex, | 77 | buildTrigramSearchIndex, |
78 | buildWhereIdOrUUID, | 78 | buildWhereIdOrUUID, |
79 | createSimilarityAttribute, | 79 | createSimilarityAttribute, |
80 | getVideoSort, isOutdated, | 80 | getVideoSort, |
81 | isOutdated, | ||
81 | throwIfNotValid | 82 | throwIfNotValid |
82 | } from '../utils' | 83 | } from '../utils' |
83 | import { TagModel } from './tag' | 84 | import { TagModel } from './tag' |
84 | import { VideoAbuseModel } from './video-abuse' | 85 | import { VideoAbuseModel } from './video-abuse' |
85 | import { VideoChannelModel, ScopeNames as VideoChannelScopeNames } from './video-channel' | 86 | import { ScopeNames as VideoChannelScopeNames, VideoChannelModel } from './video-channel' |
86 | import { VideoCommentModel } from './video-comment' | 87 | import { VideoCommentModel } from './video-comment' |
87 | import { VideoFileModel } from './video-file' | 88 | import { VideoFileModel } from './video-file' |
88 | import { VideoShareModel } from './video-share' | 89 | import { VideoShareModel } from './video-share' |
@@ -105,6 +106,7 @@ import { UserModel } from '../account/user' | |||
105 | import { VideoImportModel } from './video-import' | 106 | import { VideoImportModel } from './video-import' |
106 | import { VideoStreamingPlaylistModel } from './video-streaming-playlist' | 107 | import { VideoStreamingPlaylistModel } from './video-streaming-playlist' |
107 | import { VideoPlaylistElementModel } from './video-playlist-element' | 108 | import { VideoPlaylistElementModel } from './video-playlist-element' |
109 | import { CONFIG } from '../../initializers/config' | ||
108 | 110 | ||
109 | // FIXME: Define indexes here because there is an issue with TS and Sequelize.literal when called directly in the annotation | 111 | // FIXME: Define indexes here because there is an issue with TS and Sequelize.literal when called directly in the annotation |
110 | const indexes: Sequelize.DefineIndexesOptions[] = [ | 112 | const indexes: Sequelize.DefineIndexesOptions[] = [ |
@@ -1664,10 +1666,10 @@ export class VideoModel extends Model<VideoModel> { | |||
1664 | name: `${this.name} ${videoFile.resolution}p${videoFile.extname}`, | 1666 | name: `${this.name} ${videoFile.resolution}p${videoFile.extname}`, |
1665 | createdBy: 'PeerTube', | 1667 | createdBy: 'PeerTube', |
1666 | announceList: [ | 1668 | announceList: [ |
1667 | [ CONFIG.WEBSERVER.WS + '://' + CONFIG.WEBSERVER.HOSTNAME + ':' + CONFIG.WEBSERVER.PORT + '/tracker/socket' ], | 1669 | [ WEBSERVER.WS + '://' + WEBSERVER.HOSTNAME + ':' + WEBSERVER.PORT + '/tracker/socket' ], |
1668 | [ CONFIG.WEBSERVER.URL + '/tracker/announce' ] | 1670 | [ WEBSERVER.URL + '/tracker/announce' ] |
1669 | ], | 1671 | ], |
1670 | urlList: [ CONFIG.WEBSERVER.URL + STATIC_PATHS.WEBSEED + this.getVideoFilename(videoFile) ] | 1672 | urlList: [ WEBSERVER.URL + STATIC_PATHS.WEBSEED + this.getVideoFilename(videoFile) ] |
1671 | } | 1673 | } |
1672 | 1674 | ||
1673 | const torrent = await createTorrentPromise(this.getVideoFilePath(videoFile), options) | 1675 | const torrent = await createTorrentPromise(this.getVideoFilePath(videoFile), options) |
@@ -1781,8 +1783,8 @@ export class VideoModel extends Model<VideoModel> { | |||
1781 | let baseUrlWs | 1783 | let baseUrlWs |
1782 | 1784 | ||
1783 | if (this.isOwned()) { | 1785 | if (this.isOwned()) { |
1784 | baseUrlHttp = CONFIG.WEBSERVER.URL | 1786 | baseUrlHttp = WEBSERVER.URL |
1785 | baseUrlWs = CONFIG.WEBSERVER.WS + '://' + CONFIG.WEBSERVER.HOSTNAME + ':' + CONFIG.WEBSERVER.PORT | 1787 | baseUrlWs = WEBSERVER.WS + '://' + WEBSERVER.HOSTNAME + ':' + WEBSERVER.PORT |
1786 | } else { | 1788 | } else { |
1787 | baseUrlHttp = REMOTE_SCHEME.HTTP + '://' + this.VideoChannel.Account.Actor.Server.host | 1789 | baseUrlHttp = REMOTE_SCHEME.HTTP + '://' + this.VideoChannel.Account.Actor.Server.host |
1788 | baseUrlWs = REMOTE_SCHEME.WS + '://' + this.VideoChannel.Account.Actor.Server.host | 1790 | baseUrlWs = REMOTE_SCHEME.WS + '://' + this.VideoChannel.Account.Actor.Server.host |