spotify-audio-api
Advanced tools
Comparing version 0.1.1 to 0.1.2
@@ -84,9 +84,2 @@ import { AxiosInstance } from "axios"; | ||
/** | ||
* searchQuery - search querystring handler | ||
* | ||
* @param query - search query | ||
* @param type - type of search to perform | ||
*/ | ||
private searchQuery; | ||
/** | ||
* searchArtists - search for an artist | ||
@@ -93,0 +86,0 @@ * |
@@ -178,14 +178,2 @@ "use strict"; | ||
/** | ||
* searchQuery - search querystring handler | ||
* | ||
* @param query - search query | ||
* @param type - type of search to perform | ||
*/ | ||
async searchQuery(query, type) { | ||
return qs.stringify({ | ||
q: query, | ||
type: type | ||
}); | ||
} | ||
/** | ||
* searchArtists - search for an artist | ||
@@ -197,4 +185,8 @@ * | ||
async searchArtists(query, callback) { | ||
const config = qs.stringify({ | ||
q: query, | ||
type: "artist" | ||
}); | ||
await this.request({ | ||
uri: `/search?${this.searchQuery(query, "artist")}`, | ||
uri: `/search?${config}`, | ||
error: "Error searching artists" | ||
@@ -212,4 +204,8 @@ }, (data) => { | ||
async searchTracks(query, callback) { | ||
const config = qs.stringify({ | ||
q: query, | ||
type: "track" | ||
}); | ||
await this.request({ | ||
uri: `/search?${this.searchQuery(query, "track")}`, | ||
uri: `/search?${config}`, | ||
error: "Error searching tracks" | ||
@@ -227,4 +223,8 @@ }, (data) => { | ||
async searchAlbums(query, callback) { | ||
const config = qs.stringify({ | ||
q: query, | ||
type: "album" | ||
}); | ||
await this.request({ | ||
uri: `/search?${this.searchQuery(query, "album")}`, | ||
uri: `/search?${config}`, | ||
error: "Error searching albums" | ||
@@ -231,0 +231,0 @@ }, (data) => { |
{ | ||
"name": "spotify-audio-api", | ||
"version": "0.1.1", | ||
"version": "0.1.2", | ||
"description": "Spotify API wrapper to return audio metadata", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
21509
553