]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/lib/activitypub/playlist.ts
Refactor getOrCreateAPVideo
[github/Chocobozzz/PeerTube.git] / server / lib / activitypub / playlist.ts
index 7166c68a6529451dbf94ef9f38fa6cfb506505f2..8fe6e79f2eac8feb59bf8bef8cf05431fbfcccf1 100644 (file)
@@ -18,7 +18,7 @@ import { FilteredModelAttributes } from '../../types/sequelize'
 import { createPlaylistMiniatureFromUrl } from '../thumbnail'
 import { getOrCreateActorAndServerAndModel } from './actor'
 import { crawlCollectionPage } from './crawl'
-import { getOrCreateVideoAndAccountAndChannel } from './videos'
+import { getOrCreateAPVideo } from './videos'
 
 function playlistObjectToDBAttributes (playlistObject: PlaylistObject, byAccount: MAccountId, to: string[]) {
   const privacy = to.includes(ACTIVITY_PUB.PUBLIC)
@@ -169,7 +169,7 @@ async function resetVideoPlaylistElements (elementUrls: string[], playlist: MVid
         throw new Error(`Playlist element url ${elementUrl} host is different from the AP object id ${body.id}`)
       }
 
-      const { video } = await getOrCreateVideoAndAccountAndChannel({ videoObject: { id: body.url }, fetchType: 'only-video' })
+      const { video } = await getOrCreateAPVideo({ videoObject: { id: body.url }, fetchType: 'only-video' })
 
       elementsToCreate.push(playlistElementObjectToDBAttributes(body, playlist, video))
     } catch (err) {