FeedFormat,
ResultList,
ThreadsResultList,
+ Video,
VideoComment as VideoCommentServerModel,
VideoCommentAdmin,
VideoCommentCreate,
private restService: RestService
) {}
- addCommentThread (videoId: number | string, comment: VideoCommentCreate) {
+ addCommentThread (videoId: string, comment: VideoCommentCreate) {
const url = VideoCommentService.BASE_VIDEO_URL + videoId + '/comment-threads'
const normalizedComment = objectLineFeedToHtml(comment, 'text')
return this.authHttp.post<{ comment: VideoCommentServerModel }>(url, normalizedComment)
.pipe(
- map(data => this.extractVideoComment(data.comment)),
- catchError(err => this.restExtractor.handleError(err))
+ map(data => this.extractVideoComment(data.comment)),
+ catchError(err => this.restExtractor.handleError(err))
)
}
- addCommentReply (videoId: number | string, inReplyToCommentId: number, comment: VideoCommentCreate) {
+ addCommentReply (videoId: string, inReplyToCommentId: number, comment: VideoCommentCreate) {
const url = VideoCommentService.BASE_VIDEO_URL + videoId + '/comments/' + inReplyToCommentId
const normalizedComment = objectLineFeedToHtml(comment, 'text')
}
getAdminVideoComments (options: {
- pagination: RestPagination,
- sort: SortMeta,
+ pagination: RestPagination
+ sort: SortMeta
search?: string
}): Observable<ResultList<VideoCommentAdmin>> {
const { pagination, sort, search } = options
}
getVideoCommentThreads (parameters: {
- videoId: number | string,
- componentPagination: ComponentPaginationLight,
+ videoId: string
+ componentPagination: ComponentPaginationLight
sort: string
}): Observable<ThreadsResultList<VideoComment>> {
const { videoId, componentPagination, sort } = parameters
- const pagination = this.restService.componentPaginationToRestPagination(componentPagination)
+ const pagination = this.restService.componentToRestPagination(componentPagination)
let params = new HttpParams()
params = this.restService.addRestGetParams(params, pagination, sort)
}
getVideoThreadComments (parameters: {
- videoId: number | string,
+ videoId: string
threadId: number
}): Observable<VideoCommentThreadTree> {
const { videoId, threadId } = parameters
return this.authHttp
.delete(url)
- .pipe(
- map(this.restExtractor.extractDataBool),
- catchError(err => this.restExtractor.handleError(err))
- )
+ .pipe(catchError(err => this.restExtractor.handleError(err)))
}
deleteVideoComments (comments: { videoId: number | string, commentId: number }[]) {
)
}
- getVideoCommentsFeeds (videoUUID?: string) {
+ getVideoCommentsFeeds (video: Pick<Video, 'uuid'>) {
const feeds = [
{
format: FeedFormat.RSS,
}
]
- if (videoUUID !== undefined) {
+ if (video !== undefined) {
for (const feed of feeds) {
- feed.url += '?videoId=' + videoUUID
+ feed.url += '?videoId=' + video.uuid
}
}