]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - shared/server-commands/videos/imports-command.ts
Translated using Weblate (Ukrainian)
[github/Chocobozzz/PeerTube.git] / shared / server-commands / videos / imports-command.ts
index f63ed5d4bc3db2abe5ccee524831eaf37b3ca605..e307a79be8a570c4ecec75fb4fd78013e399f4f4 100644 (file)
@@ -7,13 +7,15 @@ import { AbstractCommand, OverrideCommandOptions } from '../shared'
 export class ImportsCommand extends AbstractCommand {
 
   importVideo (options: OverrideCommandOptions & {
-    attributes: VideoImportCreate & { torrentfile?: string }
+    attributes: (VideoImportCreate | { torrentfile?: string, previewfile?: string, thumbnailfile?: string })
   }) {
     const { attributes } = options
     const path = '/api/v1/videos/imports'
 
     let attaches: any = {}
     if (attributes.torrentfile) attaches = { torrentfile: attributes.torrentfile }
+    if (attributes.thumbnailfile) attaches = { thumbnailfile: attributes.thumbnailfile }
+    if (attributes.previewfile) attaches = { previewfile: attributes.previewfile }
 
     return unwrapBody<VideoImport>(this.postUploadRequest({
       ...options,
@@ -56,18 +58,18 @@ export class ImportsCommand extends AbstractCommand {
 
   getMyVideoImports (options: OverrideCommandOptions & {
     sort?: string
+    targetUrl?: string
+    videoChannelSyncId?: number
+    search?: string
   } = {}) {
-    const { sort } = options
+    const { sort, targetUrl, videoChannelSyncId, search } = options
     const path = '/api/v1/users/me/videos/imports'
 
-    const query = {}
-    if (sort) query['sort'] = sort
-
     return this.getRequestBody<ResultList<VideoImport>>({
       ...options,
 
       path,
-      query: { sort },
+      query: { sort, targetUrl, videoChannelSyncId, search },
       implicitToken: true,
       defaultExpectedStatus: HttpStatusCode.OK_200
     })