diff options
author | Chocobozzz <me@florianbigard.com> | 2022-08-17 15:36:03 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2022-08-17 15:36:03 +0200 |
commit | 690bb8f9f3413147a4f71d5ff0a3cd8170a94ce3 (patch) | |
tree | b16b8536acd2098aba8c1d6fe13a336dd6aa01a9 /client/src/app/shared | |
parent | bbd5aa7ead5f1554a0872963f957effc26d8c630 (diff) | |
download | PeerTube-690bb8f9f3413147a4f71d5ff0a3cd8170a94ce3.tar.gz PeerTube-690bb8f9f3413147a4f71d5ff0a3cd8170a94ce3.tar.zst PeerTube-690bb8f9f3413147a4f71d5ff0a3cd8170a94ce3.zip |
Prefer using Object.values
Diffstat (limited to 'client/src/app/shared')
-rw-r--r-- | client/src/app/shared/shared-search/advanced-search.model.ts | 12 | ||||
-rw-r--r-- | client/src/app/shared/shared-video-miniature/video-filters.model.ts | 6 |
2 files changed, 9 insertions, 9 deletions
diff --git a/client/src/app/shared/shared-search/advanced-search.model.ts b/client/src/app/shared/shared-search/advanced-search.model.ts index ea9baa27f..e8bb00fd3 100644 --- a/client/src/app/shared/shared-search/advanced-search.model.ts +++ b/client/src/app/shared/shared-search/advanced-search.model.ts | |||
@@ -1,4 +1,4 @@ | |||
1 | import { intoArray } from '@app/helpers' | 1 | import { splitIntoArray } from '@app/helpers' |
2 | import { | 2 | import { |
3 | BooleanBothQuery, | 3 | BooleanBothQuery, |
4 | BooleanQuery, | 4 | BooleanQuery, |
@@ -76,8 +76,8 @@ export class AdvancedSearch { | |||
76 | this.categoryOneOf = options.categoryOneOf || undefined | 76 | this.categoryOneOf = options.categoryOneOf || undefined |
77 | this.licenceOneOf = options.licenceOneOf || undefined | 77 | this.licenceOneOf = options.licenceOneOf || undefined |
78 | this.languageOneOf = options.languageOneOf || undefined | 78 | this.languageOneOf = options.languageOneOf || undefined |
79 | this.tagsOneOf = intoArray(options.tagsOneOf) | 79 | this.tagsOneOf = splitIntoArray(options.tagsOneOf) |
80 | this.tagsAllOf = intoArray(options.tagsAllOf) | 80 | this.tagsAllOf = splitIntoArray(options.tagsAllOf) |
81 | this.durationMin = options.durationMin ? parseInt(options.durationMin, 10) : undefined | 81 | this.durationMin = options.durationMin ? parseInt(options.durationMin, 10) : undefined |
82 | this.durationMax = options.durationMax ? parseInt(options.durationMax, 10) : undefined | 82 | this.durationMax = options.durationMax ? parseInt(options.durationMax, 10) : undefined |
83 | 83 | ||
@@ -152,9 +152,9 @@ export class AdvancedSearch { | |||
152 | originallyPublishedStartDate: this.originallyPublishedStartDate, | 152 | originallyPublishedStartDate: this.originallyPublishedStartDate, |
153 | originallyPublishedEndDate: this.originallyPublishedEndDate, | 153 | originallyPublishedEndDate: this.originallyPublishedEndDate, |
154 | nsfw: this.nsfw, | 154 | nsfw: this.nsfw, |
155 | categoryOneOf: intoArray(this.categoryOneOf), | 155 | categoryOneOf: splitIntoArray(this.categoryOneOf), |
156 | licenceOneOf: intoArray(this.licenceOneOf), | 156 | licenceOneOf: splitIntoArray(this.licenceOneOf), |
157 | languageOneOf: intoArray(this.languageOneOf), | 157 | languageOneOf: splitIntoArray(this.languageOneOf), |
158 | tagsOneOf: this.tagsOneOf, | 158 | tagsOneOf: this.tagsOneOf, |
159 | tagsAllOf: this.tagsAllOf, | 159 | tagsAllOf: this.tagsAllOf, |
160 | durationMin: this.durationMin, | 160 | durationMin: this.durationMin, |
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 8ad2fcd5d..73a30ca08 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,4 +1,4 @@ | |||
1 | import { intoArray, toBoolean } from '@app/helpers' | 1 | import { splitIntoArray, toBoolean } from '@app/helpers' |
2 | import { getAllPrivacies } from '@shared/core-utils' | 2 | import { getAllPrivacies } from '@shared/core-utils' |
3 | import { AttributesOnly } from '@shared/typescript-utils' | 3 | import { AttributesOnly } from '@shared/typescript-utils' |
4 | import { BooleanBothQuery, NSFWPolicyType, VideoInclude, VideoPrivacy, VideoSortField } from '@shared/models' | 4 | import { BooleanBothQuery, NSFWPolicyType, VideoInclude, VideoPrivacy, VideoSortField } from '@shared/models' |
@@ -94,8 +94,8 @@ export class VideoFilters { | |||
94 | 94 | ||
95 | if (obj.nsfw !== undefined) this.nsfw = obj.nsfw | 95 | if (obj.nsfw !== undefined) this.nsfw = obj.nsfw |
96 | 96 | ||
97 | if (obj.languageOneOf !== undefined) this.languageOneOf = intoArray(obj.languageOneOf) | 97 | if (obj.languageOneOf !== undefined) this.languageOneOf = splitIntoArray(obj.languageOneOf) |
98 | if (obj.categoryOneOf !== undefined) this.categoryOneOf = intoArray(obj.categoryOneOf) | 98 | if (obj.categoryOneOf !== undefined) this.categoryOneOf = splitIntoArray(obj.categoryOneOf) |
99 | 99 | ||
100 | if (obj.scope !== undefined) this.scope = obj.scope | 100 | if (obj.scope !== undefined) this.scope = obj.scope |
101 | if (obj.allVideos !== undefined) this.allVideos = toBoolean(obj.allVideos) | 101 | if (obj.allVideos !== undefined) this.allVideos = toBoolean(obj.allVideos) |