1
0
Fork 0
mirror of https://github.com/Chocobozzz/PeerTube.git synced 2025-10-05 02:39:33 +02:00

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
This commit is contained in:
Wicklow 2023-03-02 13:50:55 +00:00 committed by GitHub
parent c0a4982ebe
commit 692ae8c31c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 94 additions and 59 deletions

View file

@ -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<ResultList<Video>>({
...options,
path,
query: { sort },
implicitToken: true,
defaultExpectedStatus: HttpStatusCode.OK_200
})
}
get (options: OverrideCommandOptions & {
uri: string
}) {

View file

@ -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<ResultList<Video>>({
...options,
path,
query: { sort, ...this.buildListQuery(options) },
implicitToken: true,
defaultExpectedStatus: HttpStatusCode.OK_200
})
}
// ---------------------------------------------------------------------------
list (options: OverrideCommandOptions & VideosCommonQuery = {}) {