Skip to content

Commit

Permalink
Fix podcat api
Browse files Browse the repository at this point in the history
  • Loading branch information
sir-kain committed Oct 27, 2019
1 parent e8c77ec commit 1ebf28e
Showing 1 changed file with 1 addition and 18 deletions.
19 changes: 1 addition & 18 deletions src/data/resources.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,10 @@ export async function searchTracks(provider: string, name: string): Promise<Trac
res = await fetch("https://listen-api.listennotes.com/api/v2/search?type=episode&q=" + encodeURIComponent(name), {
headers: {
'Content-Type': 'application/json',
'X-ListenAPI-Key': "X-ListenAPI-Key"
'X-ListenAPI-Key': "key"
}
});
let resJson = await res.json();
console.log('resJson[] ==>', resJson['results']);
tracks = resJson["results"].map((data: any) => {
return {
title: data.title_original,
Expand All @@ -57,22 +56,6 @@ export async function searchTracks(provider: string, name: string): Promise<Trac
};
});
break;
case "Podcast":
res = await fetch("https://listen-api.listennotes.com/api/v2/search?type=episode&q=" + encodeURIComponent(name), {
headers: {
'Content-Type': 'application/json',
'X-ListenAPI-Key': "dca4aaf4712e4faa81315fbd3aa18bd2"
}
});
let resJson = await res.json();
tracks = resJson["results"].map((data: any) => {
return {
title: data.title_original,
icon: data.thumbnail,
url: data.audio
};
});
break;
}
return tracks;
}

0 comments on commit 1ebf28e

Please sign in to comment.