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.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.ts')
-rw-r--r-- | server/models/video/video.ts | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/server/models/video/video.ts b/server/models/video/video.ts index 56cc45cfe..1a10d2da2 100644 --- a/server/models/video/video.ts +++ b/server/models/video/video.ts | |||
@@ -32,7 +32,7 @@ import { getHLSDirectory, getHLSRedundancyDirectory, getHlsResolutionPlaylistFil | |||
32 | import { VideoPathManager } from '@server/lib/video-path-manager' | 32 | import { VideoPathManager } from '@server/lib/video-path-manager' |
33 | import { isVideoInPrivateDirectory } from '@server/lib/video-privacy' | 33 | import { isVideoInPrivateDirectory } from '@server/lib/video-privacy' |
34 | import { getServerActor } from '@server/models/application/application' | 34 | import { getServerActor } from '@server/models/application/application' |
35 | import { ModelCache } from '@server/models/model-cache' | 35 | import { ModelCache } from '@server/models/shared/model-cache' |
36 | import { buildVideoEmbedPath, buildVideoWatchPath, pick } from '@shared/core-utils' | 36 | import { buildVideoEmbedPath, buildVideoWatchPath, pick } from '@shared/core-utils' |
37 | import { ffprobePromise, getAudioStream, hasAudioStream, uuidToShort } from '@shared/extra-utils' | 37 | import { ffprobePromise, getAudioStream, hasAudioStream, uuidToShort } from '@shared/extra-utils' |
38 | import { | 38 | import { |
@@ -103,10 +103,9 @@ import { VideoRedundancyModel } from '../redundancy/video-redundancy' | |||
103 | import { ServerModel } from '../server/server' | 103 | import { ServerModel } from '../server/server' |
104 | import { TrackerModel } from '../server/tracker' | 104 | import { TrackerModel } from '../server/tracker' |
105 | import { VideoTrackerModel } from '../server/video-tracker' | 105 | import { VideoTrackerModel } from '../server/video-tracker' |
106 | import { setAsUpdated } from '../shared' | 106 | import { buildTrigramSearchIndex, buildWhereIdOrUUID, getVideoSort, isOutdated, setAsUpdated, throwIfNotValid } from '../shared' |
107 | import { UserModel } from '../user/user' | 107 | import { UserModel } from '../user/user' |
108 | import { UserVideoHistoryModel } from '../user/user-video-history' | 108 | import { UserVideoHistoryModel } from '../user/user-video-history' |
109 | import { buildTrigramSearchIndex, buildWhereIdOrUUID, getVideoSort, isOutdated, throwIfNotValid } from '../utils' | ||
110 | import { VideoViewModel } from '../view/video-view' | 109 | import { VideoViewModel } from '../view/video-view' |
111 | import { | 110 | import { |
112 | videoFilesModelToFormattedJSON, | 111 | videoFilesModelToFormattedJSON, |
@@ -1871,7 +1870,7 @@ export class VideoModel extends Model<Partial<AttributesOnly<VideoModel>>> { | |||
1871 | } | 1870 | } |
1872 | 1871 | ||
1873 | setAsRefreshed (transaction?: Transaction) { | 1872 | setAsRefreshed (transaction?: Transaction) { |
1874 | return setAsUpdated('video', this.id, transaction) | 1873 | return setAsUpdated({ sequelize: this.sequelize, table: 'video', id: this.id, transaction }) |
1875 | } | 1874 | } |
1876 | 1875 | ||
1877 | // --------------------------------------------------------------------------- | 1876 | // --------------------------------------------------------------------------- |