totalItems: null
}
sort: VideoSortField = '-publishedAt'
+ category?: number
defaultSort: VideoSortField = '-publishedAt'
syndicationItems = []
protected loadRouteParams (routeParams: { [ key: string ]: any }) {
this.sort = routeParams['sort'] as VideoSortField || this.defaultSort
-
+ this.category = routeParams['category']
if (routeParams['page'] !== undefined) {
this.pagination.currentPage = parseInt(routeParams['page'], 10)
} else {
getVideos (
videoPagination: ComponentPagination,
sort: VideoSortField,
- filter?: VideoFilter
+ filter?: VideoFilter,
+ category?: number
): Observable<{ videos: Video[], totalVideos: number }> {
const pagination = this.restService.componentPaginationToRestPagination(videoPagination)
params = params.set('filter', filter)
}
+ if (category) {
+ params = params.set('category', category + '')
+ }
+
return this.authHttp
.get<ResultList<Video>>(VideoService.BASE_VIDEO_URL, { params })
.pipe(
return feeds
}
- getVideoFeedUrls (sort: VideoSortField, filter?: VideoFilter) {
+ getVideoFeedUrls (sort: VideoSortField, filter?: VideoFilter, category?: number) {
let params = this.restService.addRestGetParams(new HttpParams(), undefined, sort)
if (filter) params = params.set('filter', filter)
+ if (category) params = params.set('category', category + '')
+
return this.buildBaseFeedUrls(params)
}
getVideosObservable (page: number) {
const newPagination = immutableAssign(this.pagination, { currentPage: page })
- return this.videoService.getVideos(newPagination, this.sort, this.filter)
+ return this.videoService.getVideos(newPagination, this.sort, this.filter, this.category)
}
generateSyndicationList () {
- this.syndicationItems = this.videoService.getVideoFeedUrls(this.sort, this.filter)
+ this.syndicationItems = this.videoService.getVideoFeedUrls(this.sort, this.filter, this.category)
}
}
getVideosObservable (page: number) {
const newPagination = immutableAssign(this.pagination, { currentPage: page })
- return this.videoService.getVideos(newPagination, this.sort)
+ return this.videoService.getVideos(newPagination, this.sort, undefined, this.category)
}
generateSyndicationList () {
- this.syndicationItems = this.videoService.getVideoFeedUrls(this.sort)
+ this.syndicationItems = this.videoService.getVideoFeedUrls(this.sort, undefined, this.category)
}
}
getVideosObservable (page: number) {
const newPagination = immutableAssign(this.pagination, { currentPage: page })
- return this.videoService.getVideos(newPagination, this.sort)
+ return this.videoService.getVideos(newPagination, this.sort, undefined, this.category)
}
generateSyndicationList () {
- this.syndicationItems = this.videoService.getVideoFeedUrls(this.sort)
+ this.syndicationItems = this.videoService.getVideoFeedUrls(this.sort, undefined, this.category)
}
}
start: req.query.start,
count: req.query.count,
sort: req.query.sort,
+ category: req.query.category,
hideNSFW: isNSFWHidden(res),
filter: req.query.filter as VideoFilter,
withFiles: false
actorId: number,
hideNSFW: boolean,
filter?: VideoFilter,
+ category?: number,
withFiles?: boolean,
accountId?: number,
videoChannelId?: number
query.where['nsfw'] = false
}
+ if (options.category) {
+ query.where['category'] = options.category
+ }
+
if (options.accountId) {
accountInclude.where = {
id: options.accountId
sort: string,
hideNSFW: boolean,
withFiles: boolean,
+ category?: number,
filter?: VideoFilter,
accountId?: number,
videoChannelId?: number
ScopeNames.AVAILABLE_FOR_LIST, {
actorId: serverActor.id,
hideNSFW: options.hideNSFW,
+ category: options.category,
filter: options.filter,
withFiles: options.withFiles,
accountId: options.accountId,
produces:
- application/json
parameters:
+ - name: category
+ in: query
+ required: false
+ type: number
+ description: category id of the video
- name: start
in: query
required: false