Skip to content

Commit

Permalink
[BandcampBridge] Fix title extraction on empty band pages (#1966)
Browse files Browse the repository at this point in the history
  • Loading branch information
VerifiedJoseph authored Mar 16, 2021
1 parent 07e1e84 commit 75b85f6
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions bridges/BandcampBridge.php
Original file line number Diff line number Diff line change
Expand Up @@ -125,9 +125,11 @@ public function collectData(){
case 'By album':
$html = getSimpleHTMLDOMCached($this->getURI(), 86400);

$titleElement = $html->find('head meta[name=title]', 0)
or returnServerError('Unable to find title on: ' . $this->getURI());
$this->feedName = $titleElement->content;
if ($html->find('meta[name=title]', 0)) {
$this->feedName = $html->find('meta[name=title]', 0)->content;
} else {
$this->feedName = str_replace('Music | ', '', $html->find('title', 0)->plaintext);
}

$regex = '/band_id=(\d+)/';
if(preg_match($regex, $html, $matches) == false)
Expand Down

0 comments on commit 75b85f6

Please sign in to comment.