aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/search/advanced-search.model.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2018-07-24 11:40:04 +0200
committerChocobozzz <me@florianbigard.com>2018-07-24 14:04:05 +0200
commit4278710d5b48546709720fac46657b84bba52a18 (patch)
tree625adb1ca2701b6b2dd02044a8fbe68eac2dda18 /client/src/app/search/advanced-search.model.ts
parentd411245096b7c9ec06e6fa2ceff7aa7b0fc0c3b7 (diff)
downloadPeerTube-4278710d5b48546709720fac46657b84bba52a18.tar.gz
PeerTube-4278710d5b48546709720fac46657b84bba52a18.tar.zst
PeerTube-4278710d5b48546709720fac46657b84bba52a18.zip
Add ability to click on category/licence/language/tags in watch page
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}