You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* @param query Search query keywords and optional field filters and operators.
90
+
* @param query Search query keywords and optional field filters and operators. You can narrow down your search using field filters. The available filters are album, artist, track, year, upc, tag:hipster, tag:new, isrc, and genre. Each field filter only applies to certain result types.
91
+
92
+
The artist filter can be used while searching albums, artists or tracks.
93
+
The album and year filters can be used while searching albums or tracks. You can filter on a single year or a range (e.g. 1955-1960).
94
+
The genre filter can be use while searching tracks and artists.
95
+
The isrc and track filters can be used while searching tracks.
96
+
The upc, tag:new and tag:hipster filters can only be used while searching albums. The tag:new filter will return albums released in the past two weeks and tag:hipster can be used to return only albums with the lowest 10% popularity.
97
+
98
+
You can also use the NOT operator to exclude keywords from your search.
99
+
100
+
Example value:
101
+
"remaster%20track:Doxy+artist:Miles%20Davis"
91
102
* @param searchTypes A list of item types to search across. Search results include hits from all the specified item types.
92
103
* @param limit Maximum number of results to return.
93
104
Default: 20
@@ -103,7 +114,10 @@ public open class SearchApi(api: GenericSpotifyApi) : SpotifyEndpoint(api) {
103
114
- Playlist results are not affected by the market parameter.
104
115
- If market is set to from_token, and a valid access token is specified in the request header, only content playable in the country associated with the user account, is returned.
105
116
- Users can view the country that is associated with their account in the account settings. A user must grant access to the [SpotifyScope.USER_READ_PRIVATE] scope prior to when the access token is issued.
117
+
**Note**: episodes will not be returned if this is NOT specified
106
118
* @param includeExternal If true, the response will include any relevant audio content that is hosted externally. By default external content is filtered out from responses.
119
+
*
120
+
* @throws IllegalArgumentException if no search types are provided, or if [SearchType.EPISODE] is provided but [market] is not
107
121
*/
108
122
publicsuspendfunsearch(
109
123
query:String,
@@ -114,6 +128,10 @@ public open class SearchApi(api: GenericSpotifyApi) : SpotifyEndpoint(api) {
114
128
includeExternal:Boolean? = null
115
129
): SpotifySearchResult {
116
130
require(searchTypes.isNotEmpty()) { "At least one search type must be provided" }
131
+
if (SearchType.EPISODEin searchTypes) {
132
+
requireNotNull(market) { "Market must be provided when SearchType.EPISODE is requested"}
val map = json.decodeFromString(MapSerializer(String.serializer(), JsonObject.serializer()), jsonString)
119
137
@@ -184,6 +202,8 @@ public open class SearchApi(api: GenericSpotifyApi) : SpotifyEndpoint(api) {
184
202
- Playlist results are not affected by the market parameter.
185
203
- If market is set to from_token, and a valid access token is specified in the request header, only content playable in the country associated with the user account, is returned.
186
204
- Users can view the country that is associated with their account in the account settings. A user must grant access to the [SpotifyScope.USER_READ_PRIVATE] scope prior to when the access token is issued.
205
+
206
+
**Note**: episodes will not be returned if this is NOT specified
187
207
* @param includeExternal If true, the response will include any relevant audio content that is hosted externally. By default external content is filtered out from responses.
0 commit comments