aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/models/video/video-channel.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2021-05-07 17:14:39 +0200
committerChocobozzz <me@florianbigard.com>2021-05-10 09:38:11 +0200
commite024fd6a7494b37251da1d59470324305cdb4129 (patch)
treee39b8c4b1bd8ba38936f0657e485358fc10b9050 /server/models/video/video-channel.ts
parent1e0741d16545ea720d04b566a808853b3975ea7f (diff)
downloadPeerTube-e024fd6a7494b37251da1d59470324305cdb4129.tar.gz
PeerTube-e024fd6a7494b37251da1d59470324305cdb4129.tar.zst
PeerTube-e024fd6a7494b37251da1d59470324305cdb4129.zip
Update channel updatedAt when uploading a video
Diffstat (limited to 'server/models/video/video-channel.ts')
-rw-r--r--server/models/video/video-channel.ts8
1 files changed, 7 insertions, 1 deletions
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 @@
1import { FindOptions, Includeable, literal, Op, QueryTypes, ScopeOptions } from 'sequelize' 1import { FindOptions, Includeable, literal, Op, QueryTypes, ScopeOptions, Transaction } from 'sequelize'
2import { 2import {
3 AllowNull, 3 AllowNull,
4 BeforeDestroy, 4 BeforeDestroy,
@@ -17,6 +17,7 @@ import {
17 Table, 17 Table,
18 UpdatedAt 18 UpdatedAt
19} from 'sequelize-typescript' 19} from 'sequelize-typescript'
20import { setAsUpdated } from '@server/helpers/database-utils'
20import { MAccountActor } from '@server/types/models' 21import { MAccountActor } from '@server/types/models'
21import { ActivityPubActor } from '../../../shared/models/activitypub' 22import { ActivityPubActor } from '../../../shared/models/activitypub'
22import { VideoChannel, VideoChannelSummary } from '../../../shared/models/videos' 23import { VideoChannel, VideoChannelSummary } from '../../../shared/models/videos'
@@ -653,6 +654,7 @@ ON "Account->Actor"."serverId" = "Account->Actor->Server"."id"`
653 description: this.description, 654 description: this.description,
654 support: this.support, 655 support: this.support,
655 isLocal: this.Actor.isOwned(), 656 isLocal: this.Actor.isOwned(),
657 updatedAt: this.updatedAt,
656 ownerAccount: undefined, 658 ownerAccount: undefined,
657 videosCount, 659 videosCount,
658 viewsPerDay 660 viewsPerDay
@@ -689,4 +691,8 @@ ON "Account->Actor"."serverId" = "Account->Actor->Server"."id"`
689 isOutdated () { 691 isOutdated () {
690 return this.Actor.isOutdated() 692 return this.Actor.isOutdated()
691 } 693 }
694
695 setAsUpdated (transaction: Transaction) {
696 return setAsUpdated('videoChannel', this.id, transaction)
697 }
692} 698}