diff options
author | Chocobozzz <me@florianbigard.com> | 2021-05-07 17:14:39 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2021-05-10 09:38:11 +0200 |
commit | e024fd6a7494b37251da1d59470324305cdb4129 (patch) | |
tree | e39b8c4b1bd8ba38936f0657e485358fc10b9050 /server/models/video/video-channel.ts | |
parent | 1e0741d16545ea720d04b566a808853b3975ea7f (diff) | |
download | PeerTube-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.ts | 8 |
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 @@ | |||
1 | import { FindOptions, Includeable, literal, Op, QueryTypes, ScopeOptions } from 'sequelize' | 1 | import { FindOptions, Includeable, literal, Op, QueryTypes, ScopeOptions, Transaction } from 'sequelize' |
2 | import { | 2 | import { |
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' |
20 | import { setAsUpdated } from '@server/helpers/database-utils' | ||
20 | import { MAccountActor } from '@server/types/models' | 21 | import { MAccountActor } from '@server/types/models' |
21 | import { ActivityPubActor } from '../../../shared/models/activitypub' | 22 | import { ActivityPubActor } from '../../../shared/models/activitypub' |
22 | import { VideoChannel, VideoChannelSummary } from '../../../shared/models/videos' | 23 | import { 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 | } |