mirror of
https://github.com/Chocobozzz/PeerTube.git
synced 2025-10-05 19:42:24 +02:00
Stronger actor association typing in AP functions
This commit is contained in:
parent
511765c9f8
commit
5224c394b3
31 changed files with 146 additions and 89 deletions
|
@ -18,8 +18,9 @@ import { VideoPlaylistPrivacy } from '../../../shared/models/videos/playlist/vid
|
|||
import { sequelizeTypescript } from '../../initializers/database'
|
||||
import { createPlaylistMiniatureFromUrl } from '../thumbnail'
|
||||
import { FilteredModelAttributes } from '../../typings/sequelize'
|
||||
import { AccountModelId } from '../../typings/models'
|
||||
|
||||
function playlistObjectToDBAttributes (playlistObject: PlaylistObject, byAccount: AccountModel, to: string[]) {
|
||||
function playlistObjectToDBAttributes (playlistObject: PlaylistObject, byAccount: AccountModelId, to: string[]) {
|
||||
const privacy = to.indexOf(ACTIVITY_PUB.PUBLIC) !== -1 ? VideoPlaylistPrivacy.PUBLIC : VideoPlaylistPrivacy.UNLISTED
|
||||
|
||||
return {
|
||||
|
@ -74,7 +75,7 @@ async function createAccountPlaylists (playlistUrls: string[], account: AccountM
|
|||
}, { concurrency: CRAWL_REQUEST_CONCURRENCY })
|
||||
}
|
||||
|
||||
async function createOrUpdateVideoPlaylist (playlistObject: PlaylistObject, byAccount: AccountModel, to: string[]) {
|
||||
async function createOrUpdateVideoPlaylist (playlistObject: PlaylistObject, byAccount: AccountModelId, to: string[]) {
|
||||
const playlistAttributes = playlistObjectToDBAttributes(playlistObject, byAccount, to)
|
||||
|
||||
if (isArray(playlistObject.attributedTo) && playlistObject.attributedTo.length === 1) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue