diff options
author | Chocobozzz <me@florianbigard.com> | 2021-10-27 14:37:04 +0200 |
---|---|---|
committer | Chocobozzz <chocobozzz@cpy.re> | 2021-10-29 11:48:21 +0200 |
commit | 2760b454a761f6af3138b2fb5f34340772ab0d1e (patch) | |
tree | 2b3a2d81478f8b432eb54cce4caa5a760c494627 /client/src/app/shared/shared-video-miniature/video-filters.model.ts | |
parent | e4611b54910d8e7f2b4f8a97ee2d9cc8e1054127 (diff) | |
download | PeerTube-2760b454a761f6af3138b2fb5f34340772ab0d1e.tar.gz PeerTube-2760b454a761f6af3138b2fb5f34340772ab0d1e.tar.zst PeerTube-2760b454a761f6af3138b2fb5f34340772ab0d1e.zip |
Deprecate filter video query
Introduce include and isLocal instead
Diffstat (limited to 'client/src/app/shared/shared-video-miniature/video-filters.model.ts')
-rw-r--r-- | client/src/app/shared/shared-video-miniature/video-filters.model.ts | 22 |
1 files changed, 12 insertions, 10 deletions
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 @@ | |||
1 | import { intoArray, toBoolean } from '@app/helpers' | 1 | import { intoArray, toBoolean } from '@app/helpers' |
2 | import { AttributesOnly } from '@shared/core-utils' | 2 | import { AttributesOnly } from '@shared/core-utils' |
3 | import { BooleanBothQuery, NSFWPolicyType, VideoFilter, VideoSortField } from '@shared/models' | 3 | import { BooleanBothQuery, NSFWPolicyType, VideoInclude, VideoSortField } from '@shared/models' |
4 | 4 | ||
5 | type VideoFiltersKeys = { | 5 | type VideoFiltersKeys = { |
6 | [ id in keyof AttributesOnly<VideoFilters> ]: any | 6 | [ id in keyof AttributesOnly<VideoFilters> ]: any |
@@ -196,14 +196,15 @@ export class VideoFilters { | |||
196 | } | 196 | } |
197 | 197 | ||
198 | toVideosAPIObject () { | 198 | toVideosAPIObject () { |
199 | let filter: VideoFilter | 199 | let isLocal: boolean |
200 | 200 | let include: VideoInclude | |
201 | if (this.scope === 'local' && this.allVideos) { | 201 | |
202 | filter = 'all-local' | 202 | if (this.scope === 'local') { |
203 | } else if (this.scope === 'federated' && this.allVideos) { | 203 | isLocal = true |
204 | filter = 'all' | 204 | } |
205 | } else if (this.scope === 'local') { | 205 | |
206 | filter = 'local' | 206 | if (this.allVideos) { |
207 | include = VideoInclude.NOT_PUBLISHED_STATE | VideoInclude.HIDDEN_PRIVACY | ||
207 | } | 208 | } |
208 | 209 | ||
209 | let isLive: boolean | 210 | let isLive: boolean |
@@ -216,7 +217,8 @@ export class VideoFilters { | |||
216 | languageOneOf: this.languageOneOf, | 217 | languageOneOf: this.languageOneOf, |
217 | categoryOneOf: this.categoryOneOf, | 218 | categoryOneOf: this.categoryOneOf, |
218 | search: this.search, | 219 | search: this.search, |
219 | filter, | 220 | isLocal, |
221 | include, | ||
220 | isLive | 222 | isLive |
221 | } | 223 | } |
222 | } | 224 | } |