Skip to content

Commit

Permalink
Merge pull request #26 from PaulWebster/master
Browse files Browse the repository at this point in the history
Mixcloud API call now requiring trailing slash
  • Loading branch information
kwarklabs authored Apr 23, 2022
2 parents 885aacc + 6c48ff5 commit e4e3e07
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions Plugin.pm
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,8 @@ sub tracksHandler {
my $parser = $passDict->{'parser'} || \&_parseTracks;
my $params = $passDict->{'params'} || '';

$params =~ s/\/$//; # Strip possible trailing / because one always added below

$log->debug('search type: ' . $searchType);
$log->debug("index: " . $index);
$log->debug("quantity: " . $quantity);
Expand Down Expand Up @@ -151,9 +153,9 @@ sub tracksHandler {

my $queryUrl;
if ($quantity == 1) {
$queryUrl = "$method://api.mixcloud.com/$resource?offset=$index&limit=$quantity" . $params;
$queryUrl = "$method://api.mixcloud.com/$resource/?offset=$index&limit=$quantity" . $params;
} else {
$queryUrl = "$method://api.mixcloud.com/$resource?limit=$quantity" . $params;
$queryUrl = "$method://api.mixcloud.com/$resource/?limit=$quantity" . $params;
}

# Adding the token to the end of each request returns more details
Expand Down

0 comments on commit e4e3e07

Please sign in to comment.