Skip to content

Commit

Permalink
Fix getStationsById when using multiple ids
Browse files Browse the repository at this point in the history
Endpoint needed for multiple URLS is /stations/byuuid?uuids=[ID(s)]
  • Loading branch information
Marky-Gee committed Jul 16, 2021
1 parent 9ad1fa5 commit 868e431
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ node_modules
/dist
/.buildcache
/.vscode/settings.json
/.vs
/scratch
/reports
/temp
Expand Down
6 changes: 3 additions & 3 deletions src/radioBrowser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -226,9 +226,9 @@ export class RadioBrowserApi {

for (const response of stations) {
if (removeDuplicates) {
const nameAndUrl = `${response.name
const nameAndUrl = `${response.name.toLowerCase().trim()}${response.url
.toLowerCase()
.trim()}${response.url.toLowerCase().trim()}`
.trim()}`

// guard against results having the same stations under different id's
if (duplicates[nameAndUrl]) continue
Expand Down Expand Up @@ -405,7 +405,7 @@ export class RadioBrowserApi {
const stationsIds = ids.join(',')
const stations = await this.runRequest<StationResponse[]>(
this.buildRequest(
`stations/byuuid/${stationsIds}`,
`stations/byuuid?uuids=${stationsIds}`,
undefined,
undefined,
false
Expand Down

0 comments on commit 868e431

Please sign in to comment.