File tree Expand file tree Collapse file tree 5 files changed +16
-12
lines changed
main/java/com/spotify/requests Expand file tree Collapse file tree 5 files changed +16
-12
lines changed Original file line number Diff line number Diff line change 77
88 <groupId >com.spotstat</groupId >
99 <artifactId >S4J</artifactId >
10- <version >1.1a</version >
10+ <version >1.1. 1a</version >
1111
1212 <properties >
1313 <maven .compiler.source>17</maven .compiler.source>
Original file line number Diff line number Diff line change @@ -166,10 +166,12 @@ public String buildRequestUrl() {
166166 }
167167
168168 String parameter = Util .join (strings , "," );
169+ parameter = parameter .replace (" " , "%20" );
169170 sb .append (parameter );
170171 sb .append ("&" );
171172 } else {
172- sb .append (o );
173+ String v = o .toString ().replace (" " , "%20" );
174+ sb .append (v );
173175 sb .append ("&" );
174176 }
175177 field .setAccessible (false );
Original file line number Diff line number Diff line change 44import com .spotify .requests .SpotifyRequest ;
55import com .spotify .requests .SpotifyRequestField ;
66import com .spotify .requests .util .Market ;
7+ import com .spotify .requests .util .Type ;
78
89
910@ SpotifyRequest ("search" )
@@ -13,7 +14,7 @@ public class SearchGet extends AbstractRequest {
1314 private final String q ;
1415
1516 @ SpotifyRequestField
16- private final String type ;
17+ private final Type [] type ;
1718
1819 @ SpotifyRequestField
1920 private String include_external ;
@@ -27,7 +28,7 @@ public class SearchGet extends AbstractRequest {
2728 @ SpotifyRequestField
2829 private int offset ;
2930
30- public SearchGet (String q , String type ) {
31+ public SearchGet (String q , Type ... type ) {
3132 this .q = q ;
3233 this .type = type ;
3334 this .include_external = null ;
Original file line number Diff line number Diff line change 44
55public enum Type {
66
7- ARTISTS ,
8- TRACKS ;
7+ ARTIST ,
8+ TRACK ;
99
1010
1111 @ Override
Original file line number Diff line number Diff line change 11package com .spotify ;
22
33import com .spotify .json .JSONObject ;
4- import com .spotify .requests .AbstractRequest ;
5- import com .spotify .requests .tracks . SeveralTrackAudioFeaturesGet ;
4+ import com .spotify .requests .search . SearchGet ;
5+ import com .spotify .requests .util . Type ;
66
77public class Main {
88
99
1010 public static void main (String [] args ) throws IllegalAccessException {
11- SpotifyClient sc = new SpotifyClientBuilderTester ().getBuiltClient ();
11+ SpotifyClient sc = new SpotifyClientBuilderTester ().printAccessToken (). getBuiltClient ();
1212
13+ SearchGet searchGet = new SearchGet ("Don't Stop artist:Fleetwood Mac" , Type .TRACK );
14+ // AbstractRequest al = new SeveralTrackAudioFeaturesGet("05lBXOMA1uHpVPEQZyjoh3", "1ljziaoMnRH95aPeOSGAtr1");
1315
14- AbstractRequest al = new SeveralTrackAudioFeaturesGet ("05lBXOMA1uHpVPEQZyjoh3" , "1ljziaoMnRH95aPeOSGAtr1" );
15-
16- JSONObject jsonObject = sc .executeRequest (al ).ok ();
16+ System .out .println (searchGet .buildRequestUrl ());
17+ JSONObject jsonObject = sc .executeRequest (searchGet ).ok ();
1718 System .out .println (jsonObject .toString (4 ));
1819
1920
You can’t perform that action at this time.
0 commit comments