mirror of
https://github.com/RSS-Bridge/rss-bridge.git
synced 2025-04-09 16:38:50 +00:00
[BandcampBridge] Add support for labels (#2286)
This commit is contained in:
parent
3764348b76
commit
fd54042ef3
@ -38,6 +38,30 @@ class BandcampBridge extends BridgeAbstract {
|
|||||||
'defaultValue' => 5
|
'defaultValue' => 5
|
||||||
)
|
)
|
||||||
),
|
),
|
||||||
|
'By label' => array(
|
||||||
|
'label' => array(
|
||||||
|
'name' => 'label',
|
||||||
|
'type' => 'text',
|
||||||
|
'title' => 'label name as seen in the label page URL',
|
||||||
|
'required' => true
|
||||||
|
),
|
||||||
|
'type' => array(
|
||||||
|
'name' => 'Articles are',
|
||||||
|
'type' => 'list',
|
||||||
|
'values' => array(
|
||||||
|
'Releases' => 'releases',
|
||||||
|
'Releases, new one when track list changes' => 'changes',
|
||||||
|
'Individual tracks' => 'tracks'
|
||||||
|
),
|
||||||
|
'defaultValue' => 'changes'
|
||||||
|
),
|
||||||
|
'limit' => array(
|
||||||
|
'name' => 'limit',
|
||||||
|
'type' => 'number',
|
||||||
|
'title' => 'Number of releases to return',
|
||||||
|
'defaultValue' => 5
|
||||||
|
)
|
||||||
|
),
|
||||||
'By album' => array(
|
'By album' => array(
|
||||||
'band' => array(
|
'band' => array(
|
||||||
'name' => 'band',
|
'name' => 'band',
|
||||||
@ -122,6 +146,7 @@ class BandcampBridge extends BridgeAbstract {
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 'By band':
|
case 'By band':
|
||||||
|
case 'By label':
|
||||||
case 'By album':
|
case 'By album':
|
||||||
$html = getSimpleHTMLDOMCached($this->getURI(), 86400);
|
$html = getSimpleHTMLDOMCached($this->getURI(), 86400);
|
||||||
|
|
||||||
@ -139,6 +164,7 @@ class BandcampBridge extends BridgeAbstract {
|
|||||||
$tralbums = array();
|
$tralbums = array();
|
||||||
switch($this->queriedContext) {
|
switch($this->queriedContext) {
|
||||||
case 'By band':
|
case 'By band':
|
||||||
|
case 'By label':
|
||||||
$query_data = array(
|
$query_data = array(
|
||||||
'band_id' => $band_id
|
'band_id' => $band_id
|
||||||
);
|
);
|
||||||
@ -289,6 +315,13 @@ class BandcampBridge extends BridgeAbstract {
|
|||||||
. '?sort_field=date';
|
. '?sort_field=date';
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
case 'By label':
|
||||||
|
if(!is_null($this->getInput('label'))) {
|
||||||
|
return 'https://'
|
||||||
|
. $this->getInput('label')
|
||||||
|
. '.bandcamp.com/music';
|
||||||
|
}
|
||||||
|
break;
|
||||||
case 'By band':
|
case 'By band':
|
||||||
if(!is_null($this->getInput('band'))) {
|
if(!is_null($this->getInput('band'))) {
|
||||||
return 'https://'
|
return 'https://'
|
||||||
@ -323,6 +356,13 @@ class BandcampBridge extends BridgeAbstract {
|
|||||||
return $this->getInput('band') . ' - Bandcamp Band';
|
return $this->getInput('band') . ' - Bandcamp Band';
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
case 'By label':
|
||||||
|
if(isset($this->feedName)) {
|
||||||
|
return $this->feedName . ' - Bandcamp Label';
|
||||||
|
} elseif(!is_null($this->getInput('label'))) {
|
||||||
|
return $this->getInput('label') . ' - Bandcamp Label';
|
||||||
|
}
|
||||||
|
break;
|
||||||
case 'By album':
|
case 'By album':
|
||||||
if(isset($this->feedName)) {
|
if(isset($this->feedName)) {
|
||||||
return $this->feedName . ' - Bandcamp Album';
|
return $this->feedName . ' - Bandcamp Album';
|
||||||
|
Loading…
Reference in New Issue
Block a user