Skip to content

Commit

Permalink
Add playlist hash to URL if the prefix is missing
Browse files Browse the repository at this point in the history
  • Loading branch information
jackwilsdon committed Mar 24, 2019
1 parent ad9a8ac commit 3657860
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/Tracks/SpotifyPlaylist.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
*/
class SpotifyPlaylist extends Track
{
const PREFIX = "x-rincon-cpcontainer:" . Helper::PLAYLIST_HASH;
const PREFIX = "x-rincon-cpcontainer:";
const REGION_EU = "2311";
const REGION_US = "3079";

Expand All @@ -28,7 +28,7 @@ public function __construct(string $uri)
{
# If this is a spotify playlist ID and not a URI then convert it to a URI now
if (substr($uri, 0, strlen(self::PREFIX)) !== self::PREFIX) {
$uri = self::PREFIX . urlencode($uri);
$uri = self::PREFIX . Helper::PLAYLIST_HASH . urlencode($uri);
}

parent::__construct($uri);
Expand All @@ -43,7 +43,7 @@ public function getMetaData(): string
{
$uri = substr($this->getUri(), strlen(self::PREFIX));

return Helper::createMetaDataXml(Helper::PLAYLIST_HASH . "{$uri}", "-1", [
return Helper::createMetaDataXml($uri, "-1", [
"dc:title" => "",
"upnp:class" => "object.container.playlistContainer",
], static::$region);
Expand Down

0 comments on commit 3657860

Please sign in to comment.