Skip to content
This repository has been archived by the owner on Jun 26, 2023. It is now read-only.

Commit

Permalink
fixed autocomplete and search bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
rnayabed committed Jan 4, 2020
1 parent 014f639 commit b38f1a8
Show file tree
Hide file tree
Showing 25 changed files with 16 additions and 13 deletions.
16 changes: 8 additions & 8 deletions .idea/workspace.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file modified out/artifacts/Gramophy_jar/Gramophy.jar
Binary file not shown.
Binary file modified out/production/Gramophy/Gramophy/dashController$10.class
Binary file not shown.
Binary file modified out/production/Gramophy/Gramophy/dashController$11$1.class
Binary file not shown.
Binary file modified out/production/Gramophy/Gramophy/dashController$11.class
Binary file not shown.
Binary file modified out/production/Gramophy/Gramophy/dashController$12$1.class
Binary file not shown.
Binary file modified out/production/Gramophy/Gramophy/dashController$12.class
Binary file not shown.
Binary file modified out/production/Gramophy/Gramophy/dashController$13.class
Binary file not shown.
Binary file modified out/production/Gramophy/Gramophy/dashController$14$1.class
Binary file not shown.
Binary file modified out/production/Gramophy/Gramophy/dashController$14.class
Binary file not shown.
Binary file modified out/production/Gramophy/Gramophy/dashController$15.class
Binary file not shown.
Binary file modified out/production/Gramophy/Gramophy/dashController$16.class
Binary file not shown.
Binary file modified out/production/Gramophy/Gramophy/dashController$17.class
Binary file not shown.
Binary file modified out/production/Gramophy/Gramophy/dashController$18.class
Binary file not shown.
Binary file modified out/production/Gramophy/Gramophy/dashController$3.class
Binary file not shown.
Binary file modified out/production/Gramophy/Gramophy/dashController$4.class
Binary file not shown.
Binary file modified out/production/Gramophy/Gramophy/dashController$5.class
Binary file not shown.
Binary file modified out/production/Gramophy/Gramophy/dashController$6.class
Binary file not shown.
Binary file modified out/production/Gramophy/Gramophy/dashController$7.class
Binary file not shown.
Binary file modified out/production/Gramophy/Gramophy/dashController$8.class
Binary file not shown.
Binary file modified out/production/Gramophy/Gramophy/dashController$9$1.class
Binary file not shown.
Binary file modified out/production/Gramophy/Gramophy/dashController$9$2.class
Binary file not shown.
Binary file modified out/production/Gramophy/Gramophy/dashController$9.class
Binary file not shown.
Binary file modified out/production/Gramophy/Gramophy/dashController.class
Binary file not shown.
13 changes: 8 additions & 5 deletions src/Gramophy/dashController.java
Original file line number Diff line number Diff line change
Expand Up @@ -294,10 +294,11 @@ protected Void call() {
Thread.sleep(150);
if(newValue.equals(youtubeSearchField.getText()))
{
isAlreadySearching = true;
String[] suggestions = getYoutubeSuggestions(newValue);

if(!isYouTubeSearching)
{
isAlreadySearching = true;
String[] suggestions = getYoutubeSuggestions(newValue);
Platform.runLater(()->{
youtubeAutoComplete.getSuggestions().setAll(suggestions);
youtubeAutoComplete.show(youtubeSearchField);
Expand Down Expand Up @@ -904,7 +905,10 @@ protected Void call() {

JSONObject youtubeResponse = new JSONObject(sb.toString());

youtubeNextPageToken = youtubeResponse.getString("nextPageToken");
if(youtubeResponse.has("nextPageToken"))
youtubeNextPageToken = youtubeResponse.getString("nextPageToken");
else
youtubeNextPageToken = "";

JSONArray resultsArray = youtubeResponse.getJSONArray("items");

Expand Down Expand Up @@ -1049,9 +1053,8 @@ protected Void call(){
loadPlaylist("YouTube");
}

if(youtubeListView.getItems().size()>0)
if(youtubeListView.getItems().size()>0 && !youtubeNextPageToken.equals(""))
{
Thread.sleep(100);
JFXButton loadMoreButton = new JFXButton("Load More");
loadMoreButton.setCache(true);
loadMoreButton.setCacheHint(CacheHint.SPEED);
Expand Down

0 comments on commit b38f1a8

Please sign in to comment.