aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/lib/activitypub/videos.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/lib/activitypub/videos.ts
parente8bafea35bc930cb8ac5b2d521a188642a1adffe (diff)
downloadPeerTube-1735c825726edaa0af5035cb6cbb0cc0db502c6d.tar.gz
PeerTube-1735c825726edaa0af5035cb6cbb0cc0db502c6d.tar.zst
PeerTube-1735c825726edaa0af5035cb6cbb0cc0db502c6d.zip
Update sequelize
Diffstat (limited to 'server/lib/activitypub/videos.ts')
-rw-r--r--server/lib/activitypub/videos.ts12
1 files changed, 6 insertions, 6 deletions
diff --git a/server/lib/activitypub/videos.ts b/server/lib/activitypub/videos.ts
index 16c37a55f..5a56942a9 100644
--- a/server/lib/activitypub/videos.ts
+++ b/server/lib/activitypub/videos.ts
@@ -6,7 +6,7 @@ import {
6 ActivityPlaylistSegmentHashesObject, 6 ActivityPlaylistSegmentHashesObject,
7 ActivityPlaylistUrlObject, 7 ActivityPlaylistUrlObject,
8 ActivityUrlObject, 8 ActivityUrlObject,
9 ActivityVideoUrlObject, VideoCreate, 9 ActivityVideoUrlObject,
10 VideoState 10 VideoState
11} from '../../../shared/index' 11} from '../../../shared/index'
12import { VideoTorrentObject } from '../../../shared/models/activitypub/objects' 12import { VideoTorrentObject } from '../../../shared/models/activitypub/objects'
@@ -45,7 +45,6 @@ import { checkUrlsSameHost, getAPId } from '../../helpers/activitypub'
45import { Notifier } from '../notifier' 45import { Notifier } from '../notifier'
46import { VideoStreamingPlaylistModel } from '../../models/video/video-streaming-playlist' 46import { VideoStreamingPlaylistModel } from '../../models/video/video-streaming-playlist'
47import { VideoStreamingPlaylistType } from '../../../shared/models/videos/video-streaming-playlist.type' 47import { VideoStreamingPlaylistType } from '../../../shared/models/videos/video-streaming-playlist.type'
48import { FilteredModelAttributes } from 'sequelize-typescript/lib/models/Model'
49import { AccountVideoRateModel } from '../../models/account/account-video-rate' 48import { AccountVideoRateModel } from '../../models/account/account-video-rate'
50import { VideoShareModel } from '../../models/video/video-share' 49import { VideoShareModel } from '../../models/video/video-share'
51import { VideoCommentModel } from '../../models/video/video-comment' 50import { VideoCommentModel } from '../../models/video/video-comment'
@@ -312,7 +311,7 @@ async function updateVideoFromAP (options: {
312 311
313 // Update or add other one 312 // Update or add other one
314 const upsertTasks = videoFileAttributes.map(a => { 313 const upsertTasks = videoFileAttributes.map(a => {
315 return VideoFileModel.upsert<VideoFileModel>(a, { returning: true, transaction: t }) 314 return (VideoFileModel.upsert<VideoFileModel>(a, { returning: true, transaction: t }) as any) // FIXME: sequelize typings
316 .then(([ file ]) => file) 315 .then(([ file ]) => file)
317 }) 316 })
318 317
@@ -335,7 +334,8 @@ async function updateVideoFromAP (options: {
335 334
336 // Update or add other one 335 // Update or add other one
337 const upsertTasks = streamingPlaylistAttributes.map(a => { 336 const upsertTasks = streamingPlaylistAttributes.map(a => {
338 return VideoStreamingPlaylistModel.upsert<VideoStreamingPlaylistModel>(a, { returning: true, transaction: t }) 337 // FIXME: sequelize typings
338 return (VideoStreamingPlaylistModel.upsert<VideoStreamingPlaylistModel>(a, { returning: true, transaction: t }) as any)
339 .then(([ streamingPlaylist ]) => streamingPlaylist) 339 .then(([ streamingPlaylist ]) => streamingPlaylist)
340 }) 340 })
341 341
@@ -594,7 +594,7 @@ function videoFileActivityUrlToDBAttributes (video: VideoModel, videoObject: Vid
594 throw new Error('Cannot find video files for ' + video.url) 594 throw new Error('Cannot find video files for ' + video.url)
595 } 595 }
596 596
597 const attributes: FilteredModelAttributes<VideoFileModel>[] = [] 597 const attributes: object[] = [] // FIXME: add typings
598 for (const fileUrl of fileUrls) { 598 for (const fileUrl of fileUrls) {
599 // Fetch associated magnet uri 599 // Fetch associated magnet uri
600 const magnet = videoObject.url.find(u => { 600 const magnet = videoObject.url.find(u => {
@@ -629,7 +629,7 @@ function streamingPlaylistActivityUrlToDBAttributes (video: VideoModel, videoObj
629 const playlistUrls = videoObject.url.filter(u => isAPStreamingPlaylistUrlObject(u)) as ActivityPlaylistUrlObject[] 629 const playlistUrls = videoObject.url.filter(u => isAPStreamingPlaylistUrlObject(u)) as ActivityPlaylistUrlObject[]
630 if (playlistUrls.length === 0) return [] 630 if (playlistUrls.length === 0) return []
631 631
632 const attributes: FilteredModelAttributes<VideoStreamingPlaylistModel>[] = [] 632 const attributes: object[] = [] // FIXME: add typings
633 for (const playlistUrlObject of playlistUrls) { 633 for (const playlistUrlObject of playlistUrls) {
634 const segmentsSha256UrlObject = playlistUrlObject.tag 634 const segmentsSha256UrlObject = playlistUrlObject.tag
635 .find(t => { 635 .find(t => {