aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/lib/activitypub/playlist.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2021-06-02 15:47:05 +0200
committerChocobozzz <me@florianbigard.com>2021-06-02 16:57:53 +0200
commit304a84d59c3a800b7f7aef48cf55f307534c0926 (patch)
treee099aefd76aa8ee5aacef7ddfc59d79111fe474b /server/lib/activitypub/playlist.ts
parentc56faf0d9453490737f283b29a203bb1ca632b95 (diff)
downloadPeerTube-304a84d59c3a800b7f7aef48cf55f307534c0926.tar.gz
PeerTube-304a84d59c3a800b7f7aef48cf55f307534c0926.tar.zst
PeerTube-304a84d59c3a800b7f7aef48cf55f307534c0926.zip
Refactor getOrCreateAPVideo
Diffstat (limited to 'server/lib/activitypub/playlist.ts')
-rw-r--r--server/lib/activitypub/playlist.ts4
1 files changed, 2 insertions, 2 deletions
diff --git a/server/lib/activitypub/playlist.ts b/server/lib/activitypub/playlist.ts
index 7166c68a6..8fe6e79f2 100644
--- a/server/lib/activitypub/playlist.ts
+++ b/server/lib/activitypub/playlist.ts
@@ -18,7 +18,7 @@ import { FilteredModelAttributes } from '../../types/sequelize'
18import { createPlaylistMiniatureFromUrl } from '../thumbnail' 18import { createPlaylistMiniatureFromUrl } from '../thumbnail'
19import { getOrCreateActorAndServerAndModel } from './actor' 19import { getOrCreateActorAndServerAndModel } from './actor'
20import { crawlCollectionPage } from './crawl' 20import { crawlCollectionPage } from './crawl'
21import { getOrCreateVideoAndAccountAndChannel } from './videos' 21import { getOrCreateAPVideo } from './videos'
22 22
23function playlistObjectToDBAttributes (playlistObject: PlaylistObject, byAccount: MAccountId, to: string[]) { 23function playlistObjectToDBAttributes (playlistObject: PlaylistObject, byAccount: MAccountId, to: string[]) {
24 const privacy = to.includes(ACTIVITY_PUB.PUBLIC) 24 const privacy = to.includes(ACTIVITY_PUB.PUBLIC)
@@ -169,7 +169,7 @@ async function resetVideoPlaylistElements (elementUrls: string[], playlist: MVid
169 throw new Error(`Playlist element url ${elementUrl} host is different from the AP object id ${body.id}`) 169 throw new Error(`Playlist element url ${elementUrl} host is different from the AP object id ${body.id}`)
170 } 170 }
171 171
172 const { video } = await getOrCreateVideoAndAccountAndChannel({ videoObject: { id: body.url }, fetchType: 'only-video' }) 172 const { video } = await getOrCreateAPVideo({ videoObject: { id: body.url }, fetchType: 'only-video' })
173 173
174 elementsToCreate.push(playlistElementObjectToDBAttributes(body, playlist, video)) 174 elementsToCreate.push(playlistElementObjectToDBAttributes(body, playlist, video))
175 } catch (err) { 175 } catch (err) {