Skip to content

Commit

Permalink
added html entity decoding to Bangumi
Browse files Browse the repository at this point in the history
  • Loading branch information
zqzten committed Jun 18, 2018
1 parent 2ef2cac commit 712e719
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
9 changes: 5 additions & 4 deletions src/bangumi.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,18 +43,19 @@

if ($results) {
foreach ($results as $sugg) {
$name = $sugg->name;
$nameCN = $sugg->name_cn;
$name = html_entity_decode($sugg->name, ENT_QUOTES | ENT_HTML5);
$nameCN = html_entity_decode($sugg->name_cn, ENT_QUOTES | ENT_HTML5);
$url = $sugg->url;
$icon = $sugg->images === null ? ICON : $sugg->images->small;
$rank = $sugg->rank;
$score = $sugg->rating->score;
$wf->result()
->title($name)
->subtitle(($type === 'all' ? ''.$typeNameDict[$sugg->type].'' : '').$nameCN)
->arg($url)
->icon(saveAndReturnFile($sugg->images->small))
->icon(saveAndReturnFile($icon))
->autocomplete($name)
->cmd(str_replace("\r\n", '', $sugg->summary), $url)
->cmd(str_replace("\r\n", '', html_entity_decode($sugg->summary, ENT_QUOTES | ENT_HTML5)), $url)
->ctrl(($rank === 0 ? '' : "Rank: $rank ").($score === 0 ? '' : "Score: $score"), $url)
->copy($name)
->quicklookurl($url);
Expand Down
2 changes: 1 addition & 1 deletion src/info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -1263,7 +1263,7 @@ require_once('moegirlpedia.php');</string>
<string>proxy</string>
</array>
<key>version</key>
<string>1.9</string>
<string>1.10</string>
<key>webaddress</key>
<string>https://github.com/AkikoZ/alfred-web-search-suggest</string>
</dict>
Expand Down

0 comments on commit 712e719

Please sign in to comment.