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:
parent
c0a4982ebe
commit
692ae8c31c
8 changed files with 94 additions and 59 deletions
|
@ -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
|
||||
}) {
|
||||
|
|
|
@ -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 = {}) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue