Skip to content

Commit

Permalink
spouts/reddit2: ignore self & default thumbnails
Browse files Browse the repository at this point in the history
Posts without a thumbnail have it set to default (or self for selfposts).
  • Loading branch information
jtojnar committed May 15, 2019
1 parent 0ea67f9 commit 3967955
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion spouts/reddit/reddit2.php
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,11 @@ public function getLink() {
*/
public function getThumbnail() {
if ($this->items !== null && $this->valid()) {
return @current($this->items)['data']['thumbnail'];
$thumbnail = @current($this->items)['data']['thumbnail'];

if (!in_array($thumbnail, ['default', 'self'])) {
return $thumbnail;
}
}

return null;
Expand Down

0 comments on commit 3967955

Please sign in to comment.