aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/models/video/video-caption.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2019-04-18 11:28:17 +0200
committerChocobozzz <me@florianbigard.com>2019-04-24 16:26:20 +0200
commit1735c825726edaa0af5035cb6cbb0cc0db502c6d (patch)
tree7bbb442f2cb4d7be58a4e08d87f5974403a3047c /server/models/video/video-caption.ts
parente8bafea35bc930cb8ac5b2d521a188642a1adffe (diff)
downloadPeerTube-1735c825726edaa0af5035cb6cbb0cc0db502c6d.tar.gz
PeerTube-1735c825726edaa0af5035cb6cbb0cc0db502c6d.tar.zst
PeerTube-1735c825726edaa0af5035cb6cbb0cc0db502c6d.zip
Update sequelize
Diffstat (limited to 'server/models/video/video-caption.ts')
-rw-r--r--server/models/video/video-caption.ts10
1 files changed, 5 insertions, 5 deletions
diff --git a/server/models/video/video-caption.ts b/server/models/video/video-caption.ts
index f2dbbfde8..45c60e26b 100644
--- a/server/models/video/video-caption.ts
+++ b/server/models/video/video-caption.ts
@@ -1,4 +1,4 @@
1import * as Sequelize from 'sequelize' 1import { OrderItem, Transaction } from 'sequelize'
2import { 2import {
3 AllowNull, 3 AllowNull,
4 BeforeDestroy, 4 BeforeDestroy,
@@ -115,19 +115,19 @@ export class VideoCaptionModel extends Model<VideoCaptionModel> {
115 return VideoCaptionModel.findOne(query) 115 return VideoCaptionModel.findOne(query)
116 } 116 }
117 117
118 static insertOrReplaceLanguage (videoId: number, language: string, transaction: Sequelize.Transaction) { 118 static insertOrReplaceLanguage (videoId: number, language: string, transaction: Transaction) {
119 const values = { 119 const values = {
120 videoId, 120 videoId,
121 language 121 language
122 } 122 }
123 123
124 return VideoCaptionModel.upsert<VideoCaptionModel>(values, { transaction, returning: true }) 124 return (VideoCaptionModel.upsert<VideoCaptionModel>(values, { transaction, returning: true }) as any) // FIXME: typings
125 .then(([ caption ]) => caption) 125 .then(([ caption ]) => caption)
126 } 126 }
127 127
128 static listVideoCaptions (videoId: number) { 128 static listVideoCaptions (videoId: number) {
129 const query = { 129 const query = {
130 order: [ [ 'language', 'ASC' ] ], 130 order: [ [ 'language', 'ASC' ] ] as OrderItem[],
131 where: { 131 where: {
132 videoId 132 videoId
133 } 133 }
@@ -140,7 +140,7 @@ export class VideoCaptionModel extends Model<VideoCaptionModel> {
140 return VIDEO_LANGUAGES[language] || 'Unknown' 140 return VIDEO_LANGUAGES[language] || 'Unknown'
141 } 141 }
142 142
143 static deleteAllCaptionsOfRemoteVideo (videoId: number, transaction: Sequelize.Transaction) { 143 static deleteAllCaptionsOfRemoteVideo (videoId: number, transaction: Transaction) {
144 const query = { 144 const query = {
145 where: { 145 where: {
146 videoId 146 videoId