]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/lib/activitypub/videos.ts
Handle reports from mastodon
[github/Chocobozzz/PeerTube.git] / server / lib / activitypub / videos.ts
index 5c10f976468451af0044d3dedf8c62aaf736c616..c318978fd4fbeb4310b8eacff032e5ffa76ef062 100644 (file)
@@ -53,21 +53,19 @@ import { FilteredModelAttributes } from '../../typings/sequelize'
 import { autoBlacklistVideoIfNeeded } from '../video-blacklist'
 import { ActorFollowScoreCache } from '../files-cache'
 import {
-  MAccountActor,
+  MAccountIdActor,
   MChannelAccountLight,
   MChannelDefault,
   MChannelId,
   MVideo,
-  MVideoAccountAllFiles,
   MVideoAccountLight,
+  MVideoAccountLightBlacklistAllFiles,
   MVideoAP,
   MVideoAPWithoutCaption,
   MVideoFile,
   MVideoFullLight,
   MVideoId,
-  MVideoTag,
-  MVideoThumbnail,
-  MVideoWithAllFiles
+  MVideoThumbnail
 } from '../../typings/models'
 import { MThumbnail } from '../../typings/models/video/thumbnail'
 
@@ -215,19 +213,19 @@ function getOrCreateVideoAndAccountAndChannel (options: {
   syncParam?: SyncParam,
   fetchType?: 'all',
   allowRefresh?: boolean
-}): Promise<{ video: MVideoAccountAllFiles, created: boolean, autoBlacklisted?: boolean }>
+}): Promise<{ video: MVideoAccountLightBlacklistAllFiles, created: boolean, autoBlacklisted?: boolean }>
 function getOrCreateVideoAndAccountAndChannel (options: {
   videoObject: { id: string } | string,
   syncParam?: SyncParam,
   fetchType?: VideoFetchByUrlType,
   allowRefresh?: boolean
-}): Promise<{ video: MVideoAccountAllFiles | MVideoThumbnail, created: boolean, autoBlacklisted?: boolean }>
+}): Promise<{ video: MVideoAccountLightBlacklistAllFiles | MVideoThumbnail, created: boolean, autoBlacklisted?: boolean }>
 async function getOrCreateVideoAndAccountAndChannel (options: {
   videoObject: { id: string } | string,
   syncParam?: SyncParam,
   fetchType?: VideoFetchByUrlType,
   allowRefresh?: boolean // true by default
-}): Promise<{ video: MVideoAccountAllFiles | MVideoThumbnail, created: boolean, autoBlacklisted?: boolean }> {
+}): Promise<{ video: MVideoAccountLightBlacklistAllFiles | MVideoThumbnail, created: boolean, autoBlacklisted?: boolean }> {
   // Default params
   const syncParam = options.syncParam || { likes: true, dislikes: true, shares: true, comments: true, thumbnail: true, refreshVideo: false }
   const fetchType = options.fetchType || 'all'
@@ -265,9 +263,9 @@ async function getOrCreateVideoAndAccountAndChannel (options: {
 }
 
 async function updateVideoFromAP (options: {
-  video: MVideoAccountAllFiles,
+  video: MVideoAccountLightBlacklistAllFiles,
   videoObject: VideoTorrentObject,
-  account: MAccountActor,
+  account: MAccountIdActor,
   channel: MChannelDefault,
   overrideTo?: string[]
 }) {
@@ -422,7 +420,7 @@ async function refreshVideoIfNeeded (options: {
 
   // We need more attributes if the argument video was fetched with not enough joints
   const video = options.fetchedType === 'all'
-    ? options.video as MVideoAccountAllFiles
+    ? options.video as MVideoAccountLightBlacklistAllFiles
     : await VideoModel.loadByUrlAndPopulateAccount(options.video.url)
 
   try {