From 7177b46ca1b35aa9d7ed39a06c1dcf41a4fc6180 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Tue, 18 Jan 2022 11:23:41 +0100 Subject: Add ability to delete history element --- shared/server-commands/videos/history-command.ts | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) (limited to 'shared/server-commands') diff --git a/shared/server-commands/videos/history-command.ts b/shared/server-commands/videos/history-command.ts index 13b7150c1..e9dc63462 100644 --- a/shared/server-commands/videos/history-command.ts +++ b/shared/server-commands/videos/history-command.ts @@ -3,7 +3,7 @@ import { AbstractCommand, OverrideCommandOptions } from '../shared' export class HistoryCommand extends AbstractCommand { - wathVideo (options: OverrideCommandOptions & { + watchVideo (options: OverrideCommandOptions & { videoId: number | string currentTime: number }) { @@ -40,7 +40,22 @@ export class HistoryCommand extends AbstractCommand { }) } - remove (options: OverrideCommandOptions & { + removeElement (options: OverrideCommandOptions & { + videoId: number + }) { + const { videoId } = options + const path = '/api/v1/users/me/history/videos/' + videoId + + return this.deleteRequest({ + ...options, + + path, + implicitToken: true, + defaultExpectedStatus: HttpStatusCode.NO_CONTENT_204 + }) + } + + removeAll (options: OverrideCommandOptions & { beforeDate?: string } = {}) { const { beforeDate } = options -- cgit v1.2.3