From e024fd6a7494b37251da1d59470324305cdb4129 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Fri, 7 May 2021 17:14:39 +0200 Subject: Update channel updatedAt when uploading a video --- server/models/video/video-channel.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'server/models/video/video-channel.ts') diff --git a/server/models/video/video-channel.ts b/server/models/video/video-channel.ts index b627595c9..081b21f2d 100644 --- a/server/models/video/video-channel.ts +++ b/server/models/video/video-channel.ts @@ -1,4 +1,4 @@ -import { FindOptions, Includeable, literal, Op, QueryTypes, ScopeOptions } from 'sequelize' +import { FindOptions, Includeable, literal, Op, QueryTypes, ScopeOptions, Transaction } from 'sequelize' import { AllowNull, BeforeDestroy, @@ -17,6 +17,7 @@ import { Table, UpdatedAt } from 'sequelize-typescript' +import { setAsUpdated } from '@server/helpers/database-utils' import { MAccountActor } from '@server/types/models' import { ActivityPubActor } from '../../../shared/models/activitypub' import { VideoChannel, VideoChannelSummary } from '../../../shared/models/videos' @@ -653,6 +654,7 @@ ON "Account->Actor"."serverId" = "Account->Actor->Server"."id"` description: this.description, support: this.support, isLocal: this.Actor.isOwned(), + updatedAt: this.updatedAt, ownerAccount: undefined, videosCount, viewsPerDay @@ -689,4 +691,8 @@ ON "Account->Actor"."serverId" = "Account->Actor->Server"."id"` isOutdated () { return this.Actor.isOutdated() } + + setAsUpdated (transaction: Transaction) { + return setAsUpdated('videoChannel', this.id, transaction) + } } -- cgit v1.2.3