diff options
Diffstat (limited to 'scripts/update-host.ts')
-rwxr-xr-x | scripts/update-host.ts | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/scripts/update-host.ts b/scripts/update-host.ts index 759443623..ba4656b75 100755 --- a/scripts/update-host.ts +++ b/scripts/update-host.ts | |||
@@ -1,12 +1,14 @@ | |||
1 | import { database as db } from '../server/initializers/database' | 1 | import { getServerAccount } from '../server/helpers' |
2 | import { getServerAccount } from '../server/helpers/utils' | 2 | import { initDatabase } from '../server/initializers' |
3 | import { AccountFollowModel } from '../server/models/account/account-follow' | ||
4 | import { VideoModel } from '../server/models/video/video' | ||
3 | 5 | ||
4 | db.init(true) | 6 | initDatabase(true) |
5 | .then(() => { | 7 | .then(() => { |
6 | return getServerAccount() | 8 | return getServerAccount() |
7 | }) | 9 | }) |
8 | .then(serverAccount => { | 10 | .then(serverAccount => { |
9 | return db.AccountFollow.listAcceptedFollowingUrlsForApi([ serverAccount.id ], undefined) | 11 | return AccountFollowModel.listAcceptedFollowingUrlsForApi([ serverAccount.id ], undefined) |
10 | }) | 12 | }) |
11 | .then(res => { | 13 | .then(res => { |
12 | return res.total > 0 | 14 | return res.total > 0 |
@@ -18,7 +20,7 @@ db.init(true) | |||
18 | } | 20 | } |
19 | 21 | ||
20 | console.log('Updating torrent files.') | 22 | console.log('Updating torrent files.') |
21 | return db.Video.list() | 23 | return VideoModel.list() |
22 | }) | 24 | }) |
23 | .then(videos => { | 25 | .then(videos => { |
24 | const tasks: Promise<any>[] = [] | 26 | const tasks: Promise<any>[] = [] |