From 2760b454a761f6af3138b2fb5f34340772ab0d1e Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Wed, 27 Oct 2021 14:37:04 +0200 Subject: Deprecate filter video query Introduce include and isLocal instead --- .../shared-video-miniature/video-filters.model.ts | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) (limited to 'client/src/app/shared/shared-video-miniature/video-filters.model.ts') 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 920dc826c..5ad7cf3f7 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 @@ -1,6 +1,6 @@ import { intoArray, toBoolean } from '@app/helpers' import { AttributesOnly } from '@shared/core-utils' -import { BooleanBothQuery, NSFWPolicyType, VideoFilter, VideoSortField } from '@shared/models' +import { BooleanBothQuery, NSFWPolicyType, VideoInclude, VideoSortField } from '@shared/models' type VideoFiltersKeys = { [ id in keyof AttributesOnly ]: any @@ -196,14 +196,15 @@ export class VideoFilters { } toVideosAPIObject () { - let filter: VideoFilter - - if (this.scope === 'local' && this.allVideos) { - filter = 'all-local' - } else if (this.scope === 'federated' && this.allVideos) { - filter = 'all' - } else if (this.scope === 'local') { - filter = 'local' + let isLocal: boolean + let include: VideoInclude + + if (this.scope === 'local') { + isLocal = true + } + + if (this.allVideos) { + include = VideoInclude.NOT_PUBLISHED_STATE | VideoInclude.HIDDEN_PRIVACY } let isLive: boolean @@ -216,7 +217,8 @@ export class VideoFilters { languageOneOf: this.languageOneOf, categoryOneOf: this.categoryOneOf, search: this.search, - filter, + isLocal, + include, isLive } } -- cgit v1.2.3