From 692ae8c31caa5a404142c9f46e03fdc8dc5b233f Mon Sep 17 00:00:00 2001 From: Wicklow <123956049+wickloww@users.noreply.github.com> Date: Thu, 2 Mar 2023 13:50:55 +0000 Subject: Hotfix/filter subscription videos (#5665) * Fix filters on subscription videos * Add tests to common video filters * Improve reliability when skipping subscrition path * Better parameters for skipping subscription videos --- shared/server-commands/users/subscriptions-command.ts | 18 +----------------- shared/server-commands/videos/videos-command.ts | 14 ++++++++++++++ 2 files changed, 15 insertions(+), 17 deletions(-) (limited to 'shared/server-commands') diff --git a/shared/server-commands/users/subscriptions-command.ts b/shared/server-commands/users/subscriptions-command.ts index edc60e612..b92f037f8 100644 --- a/shared/server-commands/users/subscriptions-command.ts +++ b/shared/server-commands/users/subscriptions-command.ts @@ -1,4 +1,4 @@ -import { HttpStatusCode, ResultList, Video, VideoChannel } from '@shared/models' +import { HttpStatusCode, ResultList, VideoChannel } from '@shared/models' import { AbstractCommand, OverrideCommandOptions } from '../shared' export class SubscriptionsCommand extends AbstractCommand { @@ -38,22 +38,6 @@ export class SubscriptionsCommand extends AbstractCommand { }) } - listVideos (options: OverrideCommandOptions & { - sort?: string // default -createdAt - } = {}) { - const { sort = '-createdAt' } = options - const path = '/api/v1/users/me/subscriptions/videos' - - return this.getRequestBody>({ - ...options, - - path, - query: { sort }, - implicitToken: true, - defaultExpectedStatus: HttpStatusCode.OK_200 - }) - } - get (options: OverrideCommandOptions & { uri: string }) { diff --git a/shared/server-commands/videos/videos-command.ts b/shared/server-commands/videos/videos-command.ts index 590244484..b5df9c325 100644 --- a/shared/server-commands/videos/videos-command.ts +++ b/shared/server-commands/videos/videos-command.ts @@ -210,6 +210,20 @@ export class VideosCommand extends AbstractCommand { }) } + listMySubscriptionVideos (options: OverrideCommandOptions & VideosCommonQuery = {}) { + const { sort = '-createdAt' } = options + const path = '/api/v1/users/me/subscriptions/videos' + + return this.getRequestBody>({ + ...options, + + path, + query: { sort, ...this.buildListQuery(options) }, + implicitToken: true, + defaultExpectedStatus: HttpStatusCode.OK_200 + }) + } + // --------------------------------------------------------------------------- list (options: OverrideCommandOptions & VideosCommonQuery = {}) { -- cgit v1.2.3