[SoundCloudBridge] Use account avatar as feed icon (#1146)
This commit is contained in:
parent
b519d350bf
commit
b889e867fd
1 changed files with 12 additions and 0 deletions
|
@ -16,6 +16,8 @@ class SoundCloudBridge extends BridgeAbstract {
|
|||
|
||||
const CLIENT_ID = 'W0KEWWILAjDiRH89X0jpwzuq6rbSK08R';
|
||||
|
||||
private $feedIcon = null;
|
||||
|
||||
public function collectData(){
|
||||
|
||||
$res = json_decode(getContents(
|
||||
|
@ -25,6 +27,8 @@ class SoundCloudBridge extends BridgeAbstract {
|
|||
. self::CLIENT_ID
|
||||
)) or returnServerError('No results for this query');
|
||||
|
||||
$this->feedIcon = $res->avatar_url;
|
||||
|
||||
$tracks = json_decode(getContents(
|
||||
'https://api.soundcloud.com/users/'
|
||||
. urlencode($res->id)
|
||||
|
@ -56,6 +60,14 @@ class SoundCloudBridge extends BridgeAbstract {
|
|||
|
||||
}
|
||||
|
||||
public function getIcon(){
|
||||
if ($this->feedIcon) {
|
||||
return $this->feedIcon;
|
||||
}
|
||||
|
||||
return parent::getIcon();
|
||||
}
|
||||
|
||||
public function getName(){
|
||||
if(!is_null($this->getInput('u'))) {
|
||||
return self::NAME . ' - ' . $this->getInput('u');
|
||||
|
|
Loading…
Reference in a new issue