Skip to content

Commit

Permalink
[ARDMediathekBridge] fixing API URL, start using show title (#4170) (#…
Browse files Browse the repository at this point in the history
…4172)

The bridge stopped working after the API server stopped accepting a trailing slash after the ID in the URL. This is being fixed. Also, the show title in the JSON was ignored. This is being fixed as well
  • Loading branch information
Mar-Koeh authored Jul 30, 2024
1 parent 22b39e3 commit cb91afb
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion bridges/ARDMediathekBridge.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,11 @@ class ARDMediathekBridge extends BridgeAbstract
* @const IMAGEWIDTHPLACEHOLDER
*/
const IMAGEWIDTHPLACEHOLDER = '{width}';
/**
* Title of the current show
* @var string
*/
private $title;

const PARAMETERS = [
[
Expand Down Expand Up @@ -72,7 +77,7 @@ public function collectData()
}
}

$url = self::APIENDPOINT . $showID . '/?pageSize=' . self::PAGESIZE;
$url = self::APIENDPOINT . $showID . '?pageSize=' . self::PAGESIZE;
$rawJSON = getContents($url);
$processedJSON = json_decode($rawJSON);

Expand All @@ -93,6 +98,17 @@ public function collectData()
$this->items[] = $item;
}

$this->title = $processedJSON->title;

date_default_timezone_set($oldTz);
}

/** {@inheritdoc} */
public function getName()
{
if (!empty($this->title)) {
return $this->title;
}
return parent::getName();
}
}

0 comments on commit cb91afb

Please sign in to comment.