Skip to content

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

Fix video languages filter

Chocobozzz177eed82710e
diff --git a/client/src/app/shared/shared-video-miniature/video-filters.model.ts b/client/src/app/shared/shared-video-miniature/video-filters.model.ts
index 8488d6f202..0eaea7ed1f 100644
--- a/client/src/app/shared/shared-video-miniature/video-filters.model.ts
+++ b/client/src/app/shared/shared-video-miniature/video-filters.model.ts
@@ -176,6 +176,8 @@ export class VideoFilters {
const cloned = new VideoFilters(this.defaultValues.get('sort'), this.defaultValues.get('scope'), this.hiddenFields)
+ cloned.setDefaultLanguages(this.defaultValues.get('languageOneOf'))
+
cloned.setNSFWPolicy({
nsfwPolicy: this.nsfwPolicy,
nsfwFlagsDisplayed: this.nsfwFlagsDisplayed,
diff --git a/client/src/app/shared/shared-video-miniature/videos-list.component.ts b/client/src/app/shared/shared-video-miniature/videos-list.component.ts
index 451ae2d118..9087b2e79d 100644
--- a/client/src/app/shared/shared-video-miniature/videos-list.component.ts
+++ b/client/src/app/shared/shared-video-miniature/videos-list.component.ts
@@ -160,28 +160,29 @@ export class VideosListComponent implements OnInit, OnDestroy {
this.subscribeToAnonymousUpdate()
this.subscribeToQueryParamsChange()
- })
- this.filters.load(this.route.snapshot.queryParams)
+ this.filters.load(this.route.snapshot.queryParams)
- this.filters.onChange(() => {
- debugLogger('Filters changed', this.filters)
+ this.filters.onChange(() => {
+ debugLogger('Filters changed', this.filters)
- // We'll reload videos, but avoid weird UI effect
- this.videos = []
- this.highlightedLives = []
+ // We'll reload videos, but avoid weird UI effect
+ this.videos = []
+ this.highlightedLives = []
- this.updateUrl()
+ this.updateUrl()
- this.reloadSyndicationItems()
- this.reloadVideos()
+ this.reloadSyndicationItems()
+ this.reloadVideos()
- this.filtersChanged.emit(this.filters)
- })
+ this.filtersChanged.emit(this.filters)
+ })
+
+ this.handlePagination()
+ this.reloadSyndicationItems()
- this.handlePagination()
- this.reloadSyndicationItems()
- this.loadMoreVideos(true)
+ this.loadMoreVideos({ reset: true })
+ })
}
ngOnDestroy () {
@@ -215,7 +216,11 @@ export class VideosListComponent implements OnInit, OnDestroy {
return true
}
- loadMoreVideos (reset = false) {
+ loadMoreVideos (options: {
+ reset?: boolean
+ } = {}) {
+ const { reset = false } = options
+
let liveFilters: VideoFilters
let videoFilters: VideoFilters
@@ -246,7 +251,8 @@ export class VideosListComponent implements OnInit, OnDestroy {
reloadVideos () {
resetCurrentPage(this.pagination)
- this.loadMoreVideos(true)
+
+ this.loadMoreVideos({ reset: true })
}
removeVideoFromArray (video: Video) {
@@ -384,7 +390,7 @@ export class VideosListComponent implements OnInit, OnDestroy {
resetCurrentPage(this.pagination)
this.pagination.currentPage = +page
- this.loadMoreVideos(true)
+ this.loadMoreVideos({ reset: true })
})
}
}