diff options
Diffstat (limited to 'server/models')
-rw-r--r-- | server/models/account/account.ts | 1 | ||||
-rw-r--r-- | server/models/activitypub/actor.ts | 3 | ||||
-rw-r--r-- | server/models/video/video-channel.ts | 8 | ||||
-rw-r--r-- | server/models/video/video.ts | 7 |
4 files changed, 11 insertions, 8 deletions
diff --git a/server/models/account/account.ts b/server/models/account/account.ts index 44be0fd3c..d33353af7 100644 --- a/server/models/account/account.ts +++ b/server/models/account/account.ts | |||
@@ -411,6 +411,7 @@ export class AccountModel extends Model { | |||
411 | id: this.id, | 411 | id: this.id, |
412 | displayName: this.getDisplayName(), | 412 | displayName: this.getDisplayName(), |
413 | description: this.description, | 413 | description: this.description, |
414 | updatedAt: this.updatedAt, | ||
414 | userId: this.userId ? this.userId : undefined | 415 | userId: this.userId ? this.userId : undefined |
415 | } | 416 | } |
416 | 417 | ||
diff --git a/server/models/activitypub/actor.ts b/server/models/activitypub/actor.ts index 396a52337..1af9efac2 100644 --- a/server/models/activitypub/actor.ts +++ b/server/models/activitypub/actor.ts | |||
@@ -557,8 +557,7 @@ export class ActorModel extends Model { | |||
557 | followingCount: this.followingCount, | 557 | followingCount: this.followingCount, |
558 | followersCount: this.followersCount, | 558 | followersCount: this.followersCount, |
559 | banner, | 559 | banner, |
560 | createdAt: this.getCreatedAt(), | 560 | createdAt: this.getCreatedAt() |
561 | updatedAt: this.updatedAt | ||
562 | }) | 561 | }) |
563 | } | 562 | } |
564 | 563 | ||
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 | } |
diff --git a/server/models/video/video.ts b/server/models/video/video.ts index e55a21a6b..8c316e00c 100644 --- a/server/models/video/video.ts +++ b/server/models/video/video.ts | |||
@@ -24,6 +24,7 @@ import { | |||
24 | Table, | 24 | Table, |
25 | UpdatedAt | 25 | UpdatedAt |
26 | } from 'sequelize-typescript' | 26 | } from 'sequelize-typescript' |
27 | import { setAsUpdated } from '@server/helpers/database-utils' | ||
27 | import { buildNSFWFilter } from '@server/helpers/express-utils' | 28 | import { buildNSFWFilter } from '@server/helpers/express-utils' |
28 | import { getPrivaciesForFederation, isPrivacyForFederation, isStateForFederation } from '@server/helpers/video' | 29 | import { getPrivaciesForFederation, isPrivacyForFederation, isStateForFederation } from '@server/helpers/video' |
29 | import { LiveManager } from '@server/lib/live-manager' | 30 | import { LiveManager } from '@server/lib/live-manager' |
@@ -2053,11 +2054,7 @@ export class VideoModel extends Model { | |||
2053 | } | 2054 | } |
2054 | 2055 | ||
2055 | setAsRefreshed () { | 2056 | setAsRefreshed () { |
2056 | const options = { | 2057 | return setAsUpdated('video', this.id) |
2057 | where: { id: this.id } | ||
2058 | } | ||
2059 | |||
2060 | return VideoModel.update({ updatedAt: new Date() }, options) | ||
2061 | } | 2058 | } |
2062 | 2059 | ||
2063 | requiresAuth () { | 2060 | requiresAuth () { |