X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=server%2Fmodels%2Faccount%2Faccount-video-rate.ts;h=c593595b2b2c22d3c6716bf181345f7e8c6c38a5;hb=d5d9b6d7bfb7e9426b6462f7fdf285df39eea820;hp=8b62dd05ff9b833a4f0c94ba48853a46564fa670;hpb=453e83ea5d81d203ba34bc43cd5c2c750ba40568;p=github%2FChocobozzz%2FPeerTube.git diff --git a/server/models/account/account-video-rate.ts b/server/models/account/account-video-rate.ts index 8b62dd05f..c593595b2 100644 --- a/server/models/account/account-video-rate.ts +++ b/server/models/account/account-video-rate.ts @@ -11,7 +11,12 @@ import { isActivityPubUrlValid } from '../../helpers/custom-validators/activityp import { AccountVideoRate } from '../../../shared' import { ScopeNames as VideoChannelScopeNames, SummaryOptions, VideoChannelModel } from '../video/video-channel' import * as Bluebird from 'bluebird' -import { MAccountVideoRate, MAccountVideoRateAccountUrl, MAccountVideoRateAccountVideo } from '@server/typings/models/video/video-rate' +import { + MAccountVideoRate, + MAccountVideoRateAccountUrl, + MAccountVideoRateAccountVideo, + MAccountVideoRateFormattable +} from '@server/typings/models/video/video-rate' /* Account rates per video. @@ -145,7 +150,7 @@ export class AccountVideoRateModel extends Model { static loadLocalAndPopulateVideo ( rateType: VideoRateType, accountName: string, - videoId: number, + videoId: number | string, t?: Transaction ): Bluebird { const options: FindOptions = { @@ -248,7 +253,7 @@ export class AccountVideoRateModel extends Model { }) } - toFormattedJSON (): AccountVideoRate { + toFormattedJSON (this: MAccountVideoRateFormattable): AccountVideoRate { return { video: this.Video.toFormattedJSON(), rating: this.type