Fix BandCamp image display

This commit is contained in:
Damien Calesse 2016-03-02 13:14:22 +01:00
parent 9553505bdd
commit 386f0ca379

View file

@ -33,10 +33,14 @@ class BandcampBridge extends BridgeAbstract{
} }
foreach($html->find('li.item') as $release) { foreach($html->find('li.item') as $release) {
$script = $release->find('div.art', 0)->getAttribute('onclick');
$uri = ltrim($script, "return 'url(");
$uri = rtrim($uri, "')");
$item = new \Item(); $item = new \Item();
$item->name = $release->find('div.itemsubtext',0)->plaintext . ' - ' . $release->find('div.itemtext',0)->plaintext; $item->name = $release->find('div.itemsubtext',0)->plaintext . ' - ' . $release->find('div.itemtext',0)->plaintext;
$item->title = $release->find('div.itemsubtext',0)->plaintext . ' - ' . $release->find('div.itemtext',0)->plaintext; $item->title = $release->find('div.itemsubtext',0)->plaintext . ' - ' . $release->find('div.itemtext',0)->plaintext;
$item->content = '<img src="' . $release->find('img.art',0)->src . '"/><br/>' . $release->find('div.itemsubtext',0)->plaintext . ' - ' . $release->find('div.itemtext',0)->plaintext; $item->content = '<img src="' . $uri . '"/><br/>' . $release->find('div.itemsubtext',0)->plaintext . ' - ' . $release->find('div.itemtext',0)->plaintext;
$item->id = $release->find('a',0)->getAttribute('href'); $item->id = $release->find('a',0)->getAttribute('href');
$item->uri = $release->find('a',0)->getAttribute('href'); $item->uri = $release->find('a',0)->getAttribute('href');
$this->items[] = $item; $this->items[] = $item;