X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=shared%2Fserver-commands%2Fvideos%2Fhistory-command.ts;h=d27afcff234cbbabe89d3ed50faae3687448ac23;hb=e15bc9dcd59ebb6102d1455450d2e8bbf9f49c27;hp=13b7150c1c1d526727b96259a8c1db69035c7834;hpb=c3edc5b074aa4bb1861ed0a94d3713808e87170f;p=github%2FChocobozzz%2FPeerTube.git diff --git a/shared/server-commands/videos/history-command.ts b/shared/server-commands/videos/history-command.ts index 13b7150c1..d27afcff2 100644 --- a/shared/server-commands/videos/history-command.ts +++ b/shared/server-commands/videos/history-command.ts @@ -3,25 +3,6 @@ import { AbstractCommand, OverrideCommandOptions } from '../shared' export class HistoryCommand extends AbstractCommand { - wathVideo (options: OverrideCommandOptions & { - videoId: number | string - currentTime: number - }) { - const { videoId, currentTime } = options - - const path = '/api/v1/videos/' + videoId + '/watching' - const fields = { currentTime } - - return this.putBodyRequest({ - ...options, - - path, - fields, - implicitToken: true, - defaultExpectedStatus: HttpStatusCode.NO_CONTENT_204 - }) - } - list (options: OverrideCommandOptions & { search?: string } = {}) { @@ -40,7 +21,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