mirror of https://github.com/Chocobozzz/PeerTube
category parma -> categoryOneOf (videos list)
parent
87bec1051b
commit
d59cba295b
|
@ -24,7 +24,7 @@ export abstract class AbstractVideoList implements OnInit, OnDestroy {
|
||||||
totalItems: null
|
totalItems: null
|
||||||
}
|
}
|
||||||
sort: VideoSortField = '-publishedAt'
|
sort: VideoSortField = '-publishedAt'
|
||||||
category?: number
|
categoryOneOf?: number
|
||||||
defaultSort: VideoSortField = '-publishedAt'
|
defaultSort: VideoSortField = '-publishedAt'
|
||||||
syndicationItems = []
|
syndicationItems = []
|
||||||
|
|
||||||
|
@ -168,7 +168,7 @@ export abstract class AbstractVideoList implements OnInit, OnDestroy {
|
||||||
|
|
||||||
protected loadRouteParams (routeParams: { [ key: string ]: any }) {
|
protected loadRouteParams (routeParams: { [ key: string ]: any }) {
|
||||||
this.sort = routeParams['sort'] as VideoSortField || this.defaultSort
|
this.sort = routeParams['sort'] as VideoSortField || this.defaultSort
|
||||||
this.category = routeParams['category']
|
this.categoryOneOf = routeParams['categoryOneOf']
|
||||||
if (routeParams['page'] !== undefined) {
|
if (routeParams['page'] !== undefined) {
|
||||||
this.pagination.currentPage = parseInt(routeParams['page'], 10)
|
this.pagination.currentPage = parseInt(routeParams['page'], 10)
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -159,7 +159,7 @@ export class VideoService {
|
||||||
videoPagination: ComponentPagination,
|
videoPagination: ComponentPagination,
|
||||||
sort: VideoSortField,
|
sort: VideoSortField,
|
||||||
filter?: VideoFilter,
|
filter?: VideoFilter,
|
||||||
category?: number
|
categoryOneOf?: number
|
||||||
): Observable<{ videos: Video[], totalVideos: number }> {
|
): Observable<{ videos: Video[], totalVideos: number }> {
|
||||||
const pagination = this.restService.componentPaginationToRestPagination(videoPagination)
|
const pagination = this.restService.componentPaginationToRestPagination(videoPagination)
|
||||||
|
|
||||||
|
@ -170,8 +170,8 @@ export class VideoService {
|
||||||
params = params.set('filter', filter)
|
params = params.set('filter', filter)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (category) {
|
if (categoryOneOf) {
|
||||||
params = params.set('category', category + '')
|
params = params.set('categoryOneOf', categoryOneOf + '')
|
||||||
}
|
}
|
||||||
|
|
||||||
return this.authHttp
|
return this.authHttp
|
||||||
|
@ -207,12 +207,12 @@ export class VideoService {
|
||||||
return feeds
|
return feeds
|
||||||
}
|
}
|
||||||
|
|
||||||
getVideoFeedUrls (sort: VideoSortField, filter?: VideoFilter, category?: number) {
|
getVideoFeedUrls (sort: VideoSortField, filter?: VideoFilter, categoryOneOf?: number) {
|
||||||
let params = this.restService.addRestGetParams(new HttpParams(), undefined, sort)
|
let params = this.restService.addRestGetParams(new HttpParams(), undefined, sort)
|
||||||
|
|
||||||
if (filter) params = params.set('filter', filter)
|
if (filter) params = params.set('filter', filter)
|
||||||
|
|
||||||
if (category) params = params.set('category', category + '')
|
if (categoryOneOf) params = params.set('categoryOneOf', categoryOneOf + '')
|
||||||
|
|
||||||
return this.buildBaseFeedUrls(params)
|
return this.buildBaseFeedUrls(params)
|
||||||
}
|
}
|
||||||
|
|
|
@ -50,10 +50,10 @@ export class VideoLocalComponent extends AbstractVideoList implements OnInit, On
|
||||||
getVideosObservable (page: number) {
|
getVideosObservable (page: number) {
|
||||||
const newPagination = immutableAssign(this.pagination, { currentPage: page })
|
const newPagination = immutableAssign(this.pagination, { currentPage: page })
|
||||||
|
|
||||||
return this.videoService.getVideos(newPagination, this.sort, this.filter, this.category)
|
return this.videoService.getVideos(newPagination, this.sort, this.filter, this.categoryOneOf)
|
||||||
}
|
}
|
||||||
|
|
||||||
generateSyndicationList () {
|
generateSyndicationList () {
|
||||||
this.syndicationItems = this.videoService.getVideoFeedUrls(this.sort, this.filter, this.category)
|
this.syndicationItems = this.videoService.getVideoFeedUrls(this.sort, this.filter, this.categoryOneOf)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -48,10 +48,10 @@ export class VideoRecentlyAddedComponent extends AbstractVideoList implements On
|
||||||
getVideosObservable (page: number) {
|
getVideosObservable (page: number) {
|
||||||
const newPagination = immutableAssign(this.pagination, { currentPage: page })
|
const newPagination = immutableAssign(this.pagination, { currentPage: page })
|
||||||
|
|
||||||
return this.videoService.getVideos(newPagination, this.sort, undefined, this.category)
|
return this.videoService.getVideos(newPagination, this.sort, undefined, this.categoryOneOf)
|
||||||
}
|
}
|
||||||
|
|
||||||
generateSyndicationList () {
|
generateSyndicationList () {
|
||||||
this.syndicationItems = this.videoService.getVideoFeedUrls(this.sort, undefined, this.category)
|
this.syndicationItems = this.videoService.getVideoFeedUrls(this.sort, undefined, this.categoryOneOf)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -47,10 +47,10 @@ export class VideoTrendingComponent extends AbstractVideoList implements OnInit,
|
||||||
|
|
||||||
getVideosObservable (page: number) {
|
getVideosObservable (page: number) {
|
||||||
const newPagination = immutableAssign(this.pagination, { currentPage: page })
|
const newPagination = immutableAssign(this.pagination, { currentPage: page })
|
||||||
return this.videoService.getVideos(newPagination, this.sort, undefined, this.category)
|
return this.videoService.getVideos(newPagination, this.sort, undefined, this.categoryOneOf)
|
||||||
}
|
}
|
||||||
|
|
||||||
generateSyndicationList () {
|
generateSyndicationList () {
|
||||||
this.syndicationItems = this.videoService.getVideoFeedUrls(this.sort, undefined, this.category)
|
this.syndicationItems = this.videoService.getVideoFeedUrls(this.sort, undefined, this.categoryOneOf)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue