From fdbda9e3d6564ec908733c7019305f6a3c363a9f Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Thu, 7 Sep 2017 15:27:35 +0200 Subject: Add tests for npm run scripts --- server/models/oauth/oauth-token-interface.ts | 2 +- server/models/request/request-interface.ts | 2 +- server/models/request/request-video-event-interface.ts | 4 ++-- server/models/request/request-video-qadu-interface.ts | 4 ++-- server/models/video/author-interface.ts | 2 +- server/models/video/video-abuse-interface.ts | 2 +- server/models/video/video.ts | 2 ++ 7 files changed, 10 insertions(+), 8 deletions(-) (limited to 'server/models') diff --git a/server/models/oauth/oauth-token-interface.ts b/server/models/oauth/oauth-token-interface.ts index 97af3c815..0c947bde8 100644 --- a/server/models/oauth/oauth-token-interface.ts +++ b/server/models/oauth/oauth-token-interface.ts @@ -1,7 +1,7 @@ import * as Sequelize from 'sequelize' import * as Promise from 'bluebird' -import { UserModel } from '../user' +import { UserModel } from '../user/user-interface' export type OAuthTokenInfo = { refreshToken: string diff --git a/server/models/request/request-interface.ts b/server/models/request/request-interface.ts index 7b0ee4df9..dae35651b 100644 --- a/server/models/request/request-interface.ts +++ b/server/models/request/request-interface.ts @@ -2,7 +2,7 @@ import * as Sequelize from 'sequelize' import * as Promise from 'bluebird' import { AbstractRequestClass } from './abstract-request-interface' -import { PodInstance, PodAttributes } from '../pod' +import { PodInstance, PodAttributes } from '../pod/pod-interface' import { RequestEndpoint } from '../../../shared/models/request-scheduler.model' export type RequestsGrouped = { diff --git a/server/models/request/request-video-event-interface.ts b/server/models/request/request-video-event-interface.ts index a5032e1b1..26cabe3ba 100644 --- a/server/models/request/request-video-event-interface.ts +++ b/server/models/request/request-video-event-interface.ts @@ -2,8 +2,8 @@ import * as Sequelize from 'sequelize' import * as Promise from 'bluebird' import { AbstractRequestClass, AbstractRequestToPodClass } from './abstract-request-interface' -import { VideoInstance } from '../video' -import { PodInstance } from '../pod' +import { VideoInstance } from '../video/video-interface' +import { PodInstance } from '../pod/pod-interface' import { RequestVideoEventType } from '../../../shared/models/request-scheduler.model' diff --git a/server/models/request/request-video-qadu-interface.ts b/server/models/request/request-video-qadu-interface.ts index 9a172a4d4..b7b7b1ecc 100644 --- a/server/models/request/request-video-qadu-interface.ts +++ b/server/models/request/request-video-qadu-interface.ts @@ -2,8 +2,8 @@ import * as Sequelize from 'sequelize' import * as Promise from 'bluebird' import { AbstractRequestClass, AbstractRequestToPodClass } from './abstract-request-interface' -import { VideoInstance } from '../video' -import { PodInstance } from '../pod' +import { VideoInstance } from '../video/video-interface' +import { PodInstance } from '../pod/pod-interface' import { RequestVideoQaduType } from '../../../shared/models/request-scheduler.model' diff --git a/server/models/video/author-interface.ts b/server/models/video/author-interface.ts index dbcb85b17..52a00a1d3 100644 --- a/server/models/video/author-interface.ts +++ b/server/models/video/author-interface.ts @@ -1,7 +1,7 @@ import * as Sequelize from 'sequelize' import * as Promise from 'bluebird' -import { PodInstance } from '../pod' +import { PodInstance } from '../pod/pod-interface' export namespace AuthorMethods { export type FindOrCreateAuthor = ( diff --git a/server/models/video/video-abuse-interface.ts b/server/models/video/video-abuse-interface.ts index abc82f7ac..978268926 100644 --- a/server/models/video/video-abuse-interface.ts +++ b/server/models/video/video-abuse-interface.ts @@ -1,7 +1,7 @@ import * as Sequelize from 'sequelize' import * as Promise from 'bluebird' -import { PodInstance } from '../pod' +import { PodInstance } from '../pod/pod-interface' import { ResultList } from '../../../shared' // Don't use barrel, import just what we need diff --git a/server/models/video/video.ts b/server/models/video/video.ts index 8c69fe189..1134525f0 100644 --- a/server/models/video/video.ts +++ b/server/models/video/video.ts @@ -378,6 +378,8 @@ createTorrentAndSetInfoHash = function (this: VideoInstance, videoFile: VideoFil return createTorrentPromise(this.getVideoFilePath(videoFile), options) .then(torrent => { const filePath = join(CONFIG.STORAGE.TORRENTS_DIR, this.getTorrentFileName(videoFile)) + logger.info('Creating torrent %s.', filePath) + return writeFilePromise(filePath, torrent).then(() => torrent) }) .then(torrent => { -- cgit v1.2.3