mirror of
https://github.com/RSS-Bridge/rss-bridge.git
synced 2025-04-09 16:38:50 +00:00
[BandcampDailyBridge] Fix list duplicates (#2795)
This commit is contained in:
parent
75c4c9f256
commit
037d5866ca
@ -7,7 +7,7 @@ class BandcampDailyBridge extends BridgeAbstract {
|
|||||||
const PARAMETERS = array(
|
const PARAMETERS = array(
|
||||||
'Latest articles' => array(),
|
'Latest articles' => array(),
|
||||||
'Best of' => array(
|
'Best of' => array(
|
||||||
'content' => array(
|
'best-content' => array(
|
||||||
'name' => 'content',
|
'name' => 'content',
|
||||||
'type' => 'list',
|
'type' => 'list',
|
||||||
'values' => array(
|
'values' => array(
|
||||||
@ -28,7 +28,7 @@ class BandcampDailyBridge extends BridgeAbstract {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
'Genres' => array(
|
'Genres' => array(
|
||||||
'content' => array(
|
'genres-content' => array(
|
||||||
'name' => 'content',
|
'name' => 'content',
|
||||||
'type' => 'list',
|
'type' => 'list',
|
||||||
'values' => array(
|
'values' => array(
|
||||||
@ -62,7 +62,7 @@ class BandcampDailyBridge extends BridgeAbstract {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
'Franchises' => array(
|
'Franchises' => array(
|
||||||
'content' => array(
|
'franchises-content' => array(
|
||||||
'name' => 'content',
|
'name' => 'content',
|
||||||
'type' => 'list',
|
'type' => 'list',
|
||||||
'values' => array(
|
'values' => array(
|
||||||
@ -133,23 +133,28 @@ class BandcampDailyBridge extends BridgeAbstract {
|
|||||||
case 'Best of':
|
case 'Best of':
|
||||||
case 'Genres':
|
case 'Genres':
|
||||||
case 'Franchises':
|
case 'Franchises':
|
||||||
return self::URI . '/' . $this->getInput('content');
|
// TODO Switch to array_key_first once php >= 7.3
|
||||||
|
$contentKey = key(self::PARAMETERS[$this->queriedContext]);
|
||||||
|
return self::URI . '/' . $this->getInput($contentKey);
|
||||||
default:
|
default:
|
||||||
return parent::getURI();
|
return parent::getURI();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getName() {
|
public function getName() {
|
||||||
if ($this->queriedContext === 'Latest articles') {
|
switch($this->queriedContext) {
|
||||||
return $this->queriedContext . ' - Bandcamp Daily';
|
case 'Latest articles':
|
||||||
|
return $this->queriedContext . ' - Bandcamp Daily';
|
||||||
|
case 'Best of':
|
||||||
|
case 'Genres':
|
||||||
|
case 'Franchises':
|
||||||
|
// TODO Switch to array_key_first once php >= 7.3
|
||||||
|
$contentKey = key(self::PARAMETERS[$this->queriedContext]);
|
||||||
|
$contentValues = array_flip(self::PARAMETERS[$this->queriedContext][$contentKey]['values']);
|
||||||
|
|
||||||
|
return $contentValues[$this->getInput($contentKey)] . ' - Bandcamp Daily';
|
||||||
|
default:
|
||||||
|
return parent::getName();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!is_null($this->getInput('content'))) {
|
|
||||||
$contentValues = array_flip(self::PARAMETERS[$this->queriedContext]['content']['values']);
|
|
||||||
|
|
||||||
return $contentValues[$this->getInput('content')] . ' - Bandcamp Daily';
|
|
||||||
}
|
|
||||||
|
|
||||||
return parent::getName();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user