aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/search/advanced-search.model.ts
diff options
context:
space:
mode:
Diffstat (limited to 'client/src/app/search/advanced-search.model.ts')
-rw-r--r--client/src/app/search/advanced-search.model.ts18
1 files changed, 13 insertions, 5 deletions
diff --git a/client/src/app/search/advanced-search.model.ts b/client/src/app/search/advanced-search.model.ts
index ce22c3f84..48616a9ae 100644
--- a/client/src/app/search/advanced-search.model.ts
+++ b/client/src/app/search/advanced-search.model.ts
@@ -99,14 +99,22 @@ export class AdvancedSearch {
99 startDate: this.startDate, 99 startDate: this.startDate,
100 endDate: this.endDate, 100 endDate: this.endDate,
101 nsfw: this.nsfw, 101 nsfw: this.nsfw,
102 categoryOneOf: this.categoryOneOf ? this.categoryOneOf.split(',') : undefined, 102 categoryOneOf: this.intoArray(this.categoryOneOf),
103 licenceOneOf: this.licenceOneOf ? this.licenceOneOf.split(',') : undefined, 103 licenceOneOf: this.intoArray(this.licenceOneOf),
104 languageOneOf: this.languageOneOf ? this.languageOneOf.split(',') : undefined, 104 languageOneOf: this.intoArray(this.languageOneOf),
105 tagsOneOf: this.tagsOneOf ? this.tagsOneOf.split(',') : undefined, 105 tagsOneOf: this.intoArray(this.tagsOneOf),
106 tagsAllOf: this.tagsAllOf ? this.tagsAllOf.split(',') : undefined, 106 tagsAllOf: this.intoArray(this.tagsAllOf),
107 durationMin: this.durationMin, 107 durationMin: this.durationMin,
108 durationMax: this.durationMax, 108 durationMax: this.durationMax,
109 sort: this.sort 109 sort: this.sort
110 } 110 }
111 } 111 }
112
113 private intoArray (value: any) {
114 if (!value) return undefined
115
116 if (typeof value === 'string') return value.split(',')
117
118 return [ value ]
119 }
112} 120}