Skip to content

Commit

Permalink
Added listennotes api for podcasts
Browse files Browse the repository at this point in the history
  • Loading branch information
sir-kain committed Oct 27, 2019
1 parent 5a09f3c commit b5918cd
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 101 deletions.
16 changes: 16 additions & 0 deletions src/data/resources.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,22 @@ export async function searchTracks(provider: string, name: string): Promise<Trac
};
});
break;
case "Podcast":
res = await fetch("https://listen-api.listennotes.com/api/v2/search?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;
}
100 changes: 0 additions & 100 deletions src/data/test.js

This file was deleted.

2 changes: 1 addition & 1 deletion src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -354,4 +354,4 @@ function getWebviewContent(track: Track, result: any) {
</div>
</body>
</html>`;
}
}

0 comments on commit b5918cd

Please sign in to comment.