diff --git a/bridges/AppleMusicBridge.php b/bridges/AppleMusicBridge.php index 30119777..6fc0c3dc 100644 --- a/bridges/AppleMusicBridge.php +++ b/bridges/AppleMusicBridge.php @@ -20,6 +20,8 @@ class AppleMusicBridge extends BridgeAbstract { )); const CACHE_TIMEOUT = 21600; // 6 hours + private $title; + public function collectData() { $url = $this->getInput('url'); $html = getSimpleHTMLDOM($url) @@ -27,6 +29,8 @@ class AppleMusicBridge extends BridgeAbstract { $imgSize = $this->getInput('imgSize'); + $this->title = $html->find('title', 0)->innertext; + // Grab the json data from the page $html = $html->find('script[id=shoebox-ember-data-store]', 0); $html = strstr($html, '{'); @@ -59,4 +63,8 @@ class AppleMusicBridge extends BridgeAbstract { return $a['timestamp'] < $b['timestamp']; }); } + + public function getName() { + return $this->title ?: parent::getName(); + } }