File tree Expand file tree Collapse file tree
lib/src/main/java/xyz/gianlu/librespot/core Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -85,20 +85,18 @@ private void request(@NotNull String... types) throws IOException {
8585 try (Response response = client .newCall (request ).execute ()) {
8686 ResponseBody body = response .body ();
8787 if (body == null ) throw new IOException ("No body" );
88- try (Reader reader = body .charStream ()) {
89- JsonObject obj = JsonParser .parseReader (reader ).getAsJsonObject ();
90- HashMap <String , List <String >> map = new HashMap <>();
91- for (String type : types )
92- map .put (type , getUrls (obj , type ));
93-
94- synchronized (pool ) {
95- pool .putAll (map );
96- poolReady = true ;
97- pool .notifyAll ();
98- }
88+ JsonObject obj = JsonParser .parseReader (body .charStream ()).getAsJsonObject ();
89+ HashMap <String , List <String >> map = new HashMap <>();
90+ for (String type : types )
91+ map .put (type , getUrls (obj , type ));
9992
100- LOGGER .info ("Loaded aps into pool: " + pool );
93+ synchronized (pool ) {
94+ pool .putAll (map );
95+ poolReady = true ;
96+ pool .notifyAll ();
10197 }
98+
99+ LOGGER .info ("Loaded aps into pool: " + pool );
102100 }
103101 }
104102
You can’t perform that action at this time.
0 commit comments