X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=scripts%2Fupdate-host.ts;h=3fb5f1972dd85b6491fed4d9979533743dbeefe7;hb=d169c4ad46291b8895498da268800bec650b43f2;hp=4410e1ff7e67110fad1830c6a7526bb7f320c1a8;hpb=eb8b27c93e61a896a08923dc1ca3c87ba8cf4948;p=github%2FChocobozzz%2FPeerTube.git diff --git a/scripts/update-host.ts b/scripts/update-host.ts index 4410e1ff7..3fb5f1972 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 { getServerActor } from '../server/helpers/utils' +import { initDatabaseModels } from '../server/initializers' +import { ActorFollowModel } from '../server/models/activitypub/actor-follow' +import { VideoModel } from '../server/models/video/video' -db.init(true) +initDatabaseModels(true) .then(() => { - return getServerAccount() + return getServerActor() }) .then(serverAccount => { - return db.AccountFollow.listAcceptedFollowingUrlsForApi([ serverAccount.id ]) + return ActorFollowModel.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[] = []