- static loadLocalAndPopulateVideo (rateType: VideoRateType, accountName: string, videoId: number, transaction?: Transaction) {
- const options: IFindOptions<AccountVideoRateModel> = {
+ static listRemoteRateUrlsOfLocalVideos () {
+ const query = `SELECT "accountVideoRate".url FROM "accountVideoRate" ` +
+ `INNER JOIN account ON account.id = "accountVideoRate"."accountId" ` +
+ `INNER JOIN actor ON actor.id = account."actorId" AND actor."serverId" IS NOT NULL ` +
+ `INNER JOIN video ON video.id = "accountVideoRate"."videoId" AND video.remote IS FALSE`
+
+ return AccountVideoRateModel.sequelize.query<{ url: string }>(query, {
+ type: QueryTypes.SELECT,
+ raw: true
+ }).then(rows => rows.map(r => r.url))
+ }
+
+ static loadLocalAndPopulateVideo (
+ rateType: VideoRateType,
+ accountName: string,
+ videoId: number,
+ t?: Transaction
+ ): Promise<MAccountVideoRateAccountVideo> {
+ const options: FindOptions = {