Skip to content

Commit d27e7a3

Browse files
edgebalmarkharding
authored andcommitted
Support tiers
1 parent f544ec7 commit d27e7a3

25 files changed

+1175
-10
lines changed

Core/Features/Provider.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ public function register()
5858
'boost-rotator',
5959
'yt-importer',
6060
'settings-referrals',
61+
'channels-shop',
6162
];
6263
});
6364

Core/Minds.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ class Minds extends base
4040
Monetization\Partners\Module::class,
4141
Media\YouTubeImporter\Module::class,
4242
DismissibleWidgets\Module::class,
43+
Wire\SupportTiers\Module::class,
4344
];
4445

4546
/**

Core/Provisioner/Provisioners/ElasticSearchIndices/minds_badger.json

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,9 @@
8686
"paywall": {
8787
"type": "boolean"
8888
},
89+
"wire_support_tier": {
90+
"type": "keyword"
91+
},
8992
"public": {
9093
"type": "boolean"
9194
},
@@ -216,6 +219,9 @@
216219
"paywall": {
217220
"type": "boolean"
218221
},
222+
"wire_support_tier": {
223+
"type": "keyword"
224+
},
219225
"public": {
220226
"type": "boolean"
221227
},
@@ -354,6 +360,9 @@
354360
"paywall": {
355361
"type": "boolean"
356362
},
363+
"wire_support_tier": {
364+
"type": "keyword"
365+
},
357366
"public": {
358367
"type": "boolean"
359368
},
@@ -495,6 +504,9 @@
495504
"paywall": {
496505
"type": "boolean"
497506
},
507+
"wire_support_tier": {
508+
"type": "keyword"
509+
},
498510
"public": {
499511
"type": "boolean"
500512
},
@@ -619,6 +631,9 @@
619631
"paywall": {
620632
"type": "boolean"
621633
},
634+
"wire_support_tier": {
635+
"type": "keyword"
636+
},
622637
"public": {
623638
"type": "boolean"
624639
},
@@ -731,6 +746,9 @@
731746
"paywall": {
732747
"type": "boolean"
733748
},
749+
"wire_support_tier": {
750+
"type": "keyword"
751+
},
734752
"public": {
735753
"type": "boolean"
736754
},
@@ -889,6 +907,9 @@
889907
"paywall": {
890908
"type": "boolean"
891909
},
910+
"wire_support_tier": {
911+
"type": "keyword"
912+
},
892913
"public": {
893914
"type": "boolean"
894915
},
@@ -1019,6 +1040,9 @@
10191040
"paywall": {
10201041
"type": "boolean"
10211042
},
1043+
"wire_support_tier": {
1044+
"type": "keyword"
1045+
},
10221046
"public": {
10231047
"type": "boolean"
10241048
},
@@ -1107,6 +1131,9 @@
11071131
"paywall": {
11081132
"type": "boolean"
11091133
},
1134+
"wire_support_tier": {
1135+
"type": "keyword"
1136+
},
11101137
"public": {
11111138
"type": "boolean"
11121139
},
@@ -1219,6 +1246,9 @@
12191246
"paywall": {
12201247
"type": "boolean"
12211248
},
1249+
"wire_support_tier": {
1250+
"type": "keyword"
1251+
},
12221252
"public": {
12231253
"type": "boolean"
12241254
},
@@ -1319,6 +1349,9 @@
13191349
"paywall": {
13201350
"type": "boolean"
13211351
},
1352+
"wire_support_tier": {
1353+
"type": "keyword"
1354+
},
13221355
"public": {
13231356
"type": "boolean"
13241357
},
@@ -1389,6 +1422,9 @@
13891422
"paywall": {
13901423
"type": "boolean"
13911424
},
1425+
"wire_support_tier": {
1426+
"type": "keyword"
1427+
},
13921428
"public": {
13931429
"type": "boolean"
13941430
},
@@ -1524,6 +1560,9 @@
15241560
"paywall": {
15251561
"type": "boolean"
15261562
},
1563+
"wire_support_tier": {
1564+
"type": "keyword"
1565+
},
15271566
"public": {
15281567
"type": "boolean"
15291568
},
@@ -1666,6 +1705,9 @@
16661705
"paywall": {
16671706
"type": "boolean"
16681707
},
1708+
"wire_support_tier": {
1709+
"type": "keyword"
1710+
},
16691711
"public": {
16701712
"type": "boolean"
16711713
},
@@ -1751,6 +1793,9 @@
17511793
"paywall": {
17521794
"type": "boolean"
17531795
},
1796+
"wire_support_tier": {
1797+
"type": "keyword"
1798+
},
17541799
"public": {
17551800
"type": "boolean"
17561801
},
@@ -1866,6 +1911,9 @@
18661911
"paywall": {
18671912
"type": "boolean"
18681913
},
1914+
"wire_support_tier": {
1915+
"type": "keyword"
1916+
},
18691917
"public": {
18701918
"type": "boolean"
18711919
},
@@ -1999,6 +2047,9 @@
19992047
"paywall": {
20002048
"type": "boolean"
20012049
},
2050+
"wire_support_tier": {
2051+
"type": "keyword"
2052+
},
20022053
"public": {
20032054
"type": "boolean"
20042055
},

Core/Provisioner/Provisioners/cassandra-provision.cql

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1578,3 +1578,13 @@ CREATE TABLE minds.feature_toggles_cache_ns (
15781578
stale_at timestamp,
15791579
PRIMARY KEY (environment, feature_name)
15801580
);
1581+
1582+
CREATE TABLE minds.wire_support_tiers (
1583+
entity_guid bigint,
1584+
currency text,
1585+
guid bigint,
1586+
amount decimal,
1587+
name text,
1588+
description text,
1589+
PRIMARY KEY (entity_guid, currency, guid)
1590+
);

Core/Router/Middleware/Kernel/ErrorHandlerMiddleware.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ public function process(ServerRequestInterface $request, RequestHandlerInterface
6060
$status = 403;
6161
} catch (UserErrorException $e) {
6262
$message = $e->getMessage();
63-
$status = 400;
63+
$status = ((int) $e->getCode()) ?: 400;
6464
} catch (Exception $e) {
6565
// Log
6666
$this->logger->critical($e, ['exception' => $e]);

Core/Router/RegistryEntry.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ public function extract(string $route): array
116116
continue;
117117
}
118118

119-
$parameters[$key] = $value;
119+
$parameters[$key] = rawurldecode($value);
120120
}
121121

122122
return $parameters;

Core/Search/Mappings/EntityMapping.php

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ class EntityMapping implements MappingInterface
3535
'tags' => [ 'type' => 'text' ],
3636
'nsfw' => [ 'type' => 'integer' ],
3737
'paywall' => [ 'type' => 'boolean', '$exportField' => 'paywall' ],
38+
'wire_support_tier' => [ 'type' => 'text' ],
3839
'rating' => [ 'type' => 'integer', '$exportField' => 'rating' ],
3940
'moderator_guid' => [ 'type' => 'text'],
4041
'@moderated' => [ 'type' => 'date'],
@@ -156,6 +157,20 @@ public function map(array $defaultValues = [])
156157

157158
$map['paywall'] = $paywall;
158159

160+
// Support Tier
161+
162+
$supportTier = null;
163+
164+
if ($this->entity && ($this->entity->wire_threshold ?? null)) {
165+
$wireThreshold = is_string($this->entity->wire_threshold) ?
166+
json_decode($this->entity->wire_threshold, true) :
167+
$this->entity->wire_threshold;
168+
169+
$supportTier = $wireThreshold['support_tier']['urn'] ?? null;
170+
}
171+
172+
$map['wire_support_tier'] = $supportTier;
173+
159174
// Text
160175

161176
if (isset($map['description'])) {

0 commit comments

Comments
 (0)