Skip to content

ActivityPub-federated video streaming platform using P2P directly in your web browser

Reduce history method names

Chocobozzzc1f7a737cfe1
diff --git a/client/src/app/+my-library/my-history/my-history.component.ts b/client/src/app/+my-library/my-history/my-history.component.ts
index 34efe55583..daabca178f 100644
--- a/client/src/app/+my-library/my-history/my-history.component.ts
+++ b/client/src/app/+my-library/my-history/my-history.component.ts
@@ -95,7 +95,7 @@ export class MyHistoryComponent implements OnInit, DisableForReuseHook {
getVideosObservable (page: number) {
const newPagination = immutableAssign(this.pagination, { currentPage: page })
- return this.userHistoryService.getUserVideosHistory(newPagination, this.search)
+ return this.userHistoryService.list(newPagination, this.search)
.pipe(
tap(res => this.pagination.totalItems = res.total)
)
@@ -124,7 +124,7 @@ export class MyHistoryComponent implements OnInit, DisableForReuseHook {
}
deleteHistoryElement (video: Video) {
- this.userHistoryService.deleteUserVideoHistoryElement(video)
+ this.userHistoryService.deleteElement(video)
.subscribe({
next: () => {
this.videos = this.videos.filter(v => v.id !== video.id)
@@ -141,7 +141,7 @@ export class MyHistoryComponent implements OnInit, DisableForReuseHook {
const res = await this.confirmService.confirm(message, title)
if (res !== true) return
- this.userHistoryService.clearAllUserVideosHistory()
+ this.userHistoryService.clearAll()
.subscribe({
next: () => {
this.notifier.success($localize`Videos history deleted`)
diff --git a/client/src/app/shared/shared-main/users/user-history.service.ts b/client/src/app/shared/shared-main/users/user-history.service.ts
index e28bcdca94..0cfb2d203f 100644
--- a/client/src/app/shared/shared-main/users/user-history.service.ts
+++ b/client/src/app/shared/shared-main/users/user-history.service.ts
@@ -18,7 +18,7 @@ export class UserHistoryService {
private videoService: VideoService
) {}
- getUserVideosHistory (historyPagination: ComponentPaginationLight, search?: string) {
+ list (historyPagination: ComponentPaginationLight, search?: string) {
const pagination = this.restService.componentToRestPagination(historyPagination)
let params = new HttpParams()
@@ -34,13 +34,13 @@ export class UserHistoryService {
)
}
- deleteUserVideoHistoryElement (video: Video) {
+ deleteElement (video: Video) {
return this.authHttp
.delete(UserHistoryService.BASE_USER_VIDEOS_HISTORY_URL + '/' + video.id)
.pipe(catchError(err => this.restExtractor.handleError(err)))
}
- clearAllUserVideosHistory () {
+ clearAll () {
return this.authHttp
.post(UserHistoryService.BASE_USER_VIDEOS_HISTORY_URL + '/remove', {})
.pipe(