From 3fd3ab2d34d512b160a5e6084d7609be7b4f4452 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Tue, 12 Dec 2017 17:53:50 +0100 Subject: Move models to typescript-sequelize --- scripts/update-host.ts | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'scripts/update-host.ts') 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 @@ -import { database as db } from '../server/initializers/database' -import { getServerAccount } from '../server/helpers/utils' +import { getServerAccount } from '../server/helpers' +import { initDatabase } from '../server/initializers' +import { AccountFollowModel } from '../server/models/account/account-follow' +import { VideoModel } from '../server/models/video/video' -db.init(true) +initDatabase(true) .then(() => { return getServerAccount() }) .then(serverAccount => { - return db.AccountFollow.listAcceptedFollowingUrlsForApi([ serverAccount.id ], undefined) + return AccountFollowModel.listAcceptedFollowingUrlsForApi([ serverAccount.id ], undefined) }) .then(res => { return res.total > 0 @@ -18,7 +20,7 @@ db.init(true) } console.log('Updating torrent files.') - return db.Video.list() + return VideoModel.list() }) .then(videos => { const tasks: Promise[] = [] -- cgit v1.2.3