diff options
author | Chocobozzz <me@florianbigard.com> | 2023-01-10 11:09:30 +0100 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2023-01-10 11:56:08 +0100 |
commit | 8c4bbd946d2247c2e239cbbf8773d2d31c1a57aa (patch) | |
tree | 4e7d3711cccb095d4356c59554bdfd4e16502832 /server/models/video/video-channel.ts | |
parent | a8749f7c3b137f433e6944bb99fd721a6f0cfc1e (diff) | |
download | PeerTube-8c4bbd946d2247c2e239cbbf8773d2d31c1a57aa.tar.gz PeerTube-8c4bbd946d2247c2e239cbbf8773d2d31c1a57aa.tar.zst PeerTube-8c4bbd946d2247c2e239cbbf8773d2d31c1a57aa.zip |
Refactor model utils
Diffstat (limited to 'server/models/video/video-channel.ts')
-rw-r--r-- | server/models/video/video-channel.ts | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/server/models/video/video-channel.ts b/server/models/video/video-channel.ts index 132c8f021..b71f5a197 100644 --- a/server/models/video/video-channel.ts +++ b/server/models/video/video-channel.ts | |||
@@ -43,8 +43,14 @@ import { ActorModel, unusedActorAttributesForAPI } from '../actor/actor' | |||
43 | import { ActorFollowModel } from '../actor/actor-follow' | 43 | import { ActorFollowModel } from '../actor/actor-follow' |
44 | import { ActorImageModel } from '../actor/actor-image' | 44 | import { ActorImageModel } from '../actor/actor-image' |
45 | import { ServerModel } from '../server/server' | 45 | import { ServerModel } from '../server/server' |
46 | import { setAsUpdated } from '../shared' | 46 | import { |
47 | import { buildServerIdsFollowedBy, buildTrigramSearchIndex, createSimilarityAttribute, getSort, throwIfNotValid } from '../utils' | 47 | buildServerIdsFollowedBy, |
48 | buildTrigramSearchIndex, | ||
49 | createSimilarityAttribute, | ||
50 | getSort, | ||
51 | setAsUpdated, | ||
52 | throwIfNotValid | ||
53 | } from '../shared' | ||
48 | import { VideoModel } from './video' | 54 | import { VideoModel } from './video' |
49 | import { VideoPlaylistModel } from './video-playlist' | 55 | import { VideoPlaylistModel } from './video-playlist' |
50 | 56 | ||
@@ -831,6 +837,6 @@ export class VideoChannelModel extends Model<Partial<AttributesOnly<VideoChannel | |||
831 | } | 837 | } |
832 | 838 | ||
833 | setAsUpdated (transaction?: Transaction) { | 839 | setAsUpdated (transaction?: Transaction) { |
834 | return setAsUpdated('videoChannel', this.id, transaction) | 840 | return setAsUpdated({ sequelize: this.sequelize, table: 'videoChannel', id: this.id, transaction }) |
835 | } | 841 | } |
836 | } | 842 | } |