Skip to content

Commit 712e719

Browse files
committed
added html entity decoding to Bangumi
1 parent 2ef2cac commit 712e719

2 files changed

Lines changed: 6 additions & 5 deletions

File tree

src/bangumi.php

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,18 +43,19 @@
4343

4444
if ($results) {
4545
foreach ($results as $sugg) {
46-
$name = $sugg->name;
47-
$nameCN = $sugg->name_cn;
46+
$name = html_entity_decode($sugg->name, ENT_QUOTES | ENT_HTML5);
47+
$nameCN = html_entity_decode($sugg->name_cn, ENT_QUOTES | ENT_HTML5);
4848
$url = $sugg->url;
49+
$icon = $sugg->images === null ? ICON : $sugg->images->small;
4950
$rank = $sugg->rank;
5051
$score = $sugg->rating->score;
5152
$wf->result()
5253
->title($name)
5354
->subtitle(($type === 'all' ? ''.$typeNameDict[$sugg->type].'' : '').$nameCN)
5455
->arg($url)
55-
->icon(saveAndReturnFile($sugg->images->small))
56+
->icon(saveAndReturnFile($icon))
5657
->autocomplete($name)
57-
->cmd(str_replace("\r\n", '', $sugg->summary), $url)
58+
->cmd(str_replace("\r\n", '', html_entity_decode($sugg->summary, ENT_QUOTES | ENT_HTML5)), $url)
5859
->ctrl(($rank === 0 ? '' : "Rank: $rank ").($score === 0 ? '' : "Score: $score"), $url)
5960
->copy($name)
6061
->quicklookurl($url);

src/info.plist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1263,7 +1263,7 @@ require_once('moegirlpedia.php');</string>
12631263
<string>proxy</string>
12641264
</array>
12651265
<key>version</key>
1266-
<string>1.9</string>
1266+
<string>1.10</string>
12671267
<key>webaddress</key>
12681268
<string>https://github.com/AkikoZ/alfred-web-search-suggest</string>
12691269
</dict>

0 commit comments

Comments
 (0)