diff --git a/bin/application/Main.class b/bin/application/Main.class index 10dfb0c..9a4b3ac 100644 Binary files a/bin/application/Main.class and b/bin/application/Main.class differ diff --git a/bin/application/MainWindow.fxml b/bin/application/MainWindow.fxml index 8b41bd8..803f728 100644 --- a/bin/application/MainWindow.fxml +++ b/bin/application/MainWindow.fxml @@ -81,8 +81,8 @@ - - + + diff --git a/bin/application/MainWindowController$1.class b/bin/application/MainWindowController$1.class index f602b41..c392df7 100644 Binary files a/bin/application/MainWindowController$1.class and b/bin/application/MainWindowController$1.class differ diff --git a/bin/application/MainWindowController$2.class b/bin/application/MainWindowController$2.class index fba7c04..d6a1ab4 100644 Binary files a/bin/application/MainWindowController$2.class and b/bin/application/MainWindowController$2.class differ diff --git a/bin/application/MainWindowController$3.class b/bin/application/MainWindowController$3.class index 2b78f19..fc86b80 100644 Binary files a/bin/application/MainWindowController$3.class and b/bin/application/MainWindowController$3.class differ diff --git a/bin/application/MainWindowController$4.class b/bin/application/MainWindowController$4.class index f00482b..66c3735 100644 Binary files a/bin/application/MainWindowController$4.class and b/bin/application/MainWindowController$4.class differ diff --git a/bin/application/MainWindowController$5.class b/bin/application/MainWindowController$5.class index 4726153..64a6d23 100644 Binary files a/bin/application/MainWindowController$5.class and b/bin/application/MainWindowController$5.class differ diff --git a/bin/application/MainWindowController$6.class b/bin/application/MainWindowController$6.class index c1b2b09..5f0c70e 100644 Binary files a/bin/application/MainWindowController$6.class and b/bin/application/MainWindowController$6.class differ diff --git a/bin/application/MainWindowController$7.class b/bin/application/MainWindowController$7.class index 117bf7a..9f1378c 100644 Binary files a/bin/application/MainWindowController$7.class and b/bin/application/MainWindowController$7.class differ diff --git a/bin/application/MainWindowController.class b/bin/application/MainWindowController.class index 433dd72..bd3b673 100644 Binary files a/bin/application/MainWindowController.class and b/bin/application/MainWindowController.class differ diff --git a/bin/application/apiQuery.class b/bin/application/apiQuery.class index ab8b84b..3979347 100644 Binary files a/bin/application/apiQuery.class and b/bin/application/apiQuery.class differ diff --git a/bin/application/updater.class b/bin/application/updater.class index 047b402..2185f2c 100644 Binary files a/bin/application/updater.class and b/bin/application/updater.class differ diff --git a/src/application/DBController.java b/src/application/DBController.java index de7a90c..9e0be27 100644 --- a/src/application/DBController.java +++ b/src/application/DBController.java @@ -245,7 +245,7 @@ void loadData(){ stmt.close(); rs.close(); - //load streaming Data TODO check if there are streaming data before loading -> maybe there is an issue now + //load streaming Data FIXME check if there are streaming data before loading -> maybe there is an issue now rs = stmt.executeQuery("SELECT * FROM film_streaming ORDER BY titel;"); while (rs.next()) { if(rs.getString(8).equals("favorite_black")){ @@ -264,7 +264,7 @@ void loadData(){ } //Refreshes the data in mainWindowController.newDaten and mainWindowController.streamData - //TODO it seems that there is an issue at the moment with streaming refreshing wrong entry if there is more than one with the same name + //FIXME it seems that there is an issue at the moment with streaming refreshing wrong entry if there is more than one with the same name void refresh(String name,int i) throws SQLException{ System.out.println("refresh ..."); Statement stmt; diff --git a/src/application/Main.java b/src/application/Main.java index 1be3727..cff2f19 100644 --- a/src/application/Main.java +++ b/src/application/Main.java @@ -44,8 +44,6 @@ public class Main extends Application { Stage primaryStage; private String path; String currentWorkingDirectory; -// private String streamingPathWin = System.getProperty("user.home") + "\\Documents\\HomeFlix"; -// private String streamingPathLinux = System.getProperty("user.home") + "/HomeFlix"; private String COLOR = "ee3523"; private String FONT_FAMILY = "System"; private String mode = "local"; //local or streaming TODO @@ -110,7 +108,7 @@ private void mainWindow(){ mainWindowController.setMode(mode); mainWindowController.saveSettings(); Runtime.getRuntime().exec("java -jar ProjectHomeFlix.jar"); //start again (preventing Bugs) - System.exit(0); //finishes itse + System.exit(0); //finishes it self } if(!posterCache.exists()) { diff --git a/src/application/MainWindow.fxml b/src/application/MainWindow.fxml index 8b41bd8..803f728 100644 --- a/src/application/MainWindow.fxml +++ b/src/application/MainWindow.fxml @@ -81,8 +81,8 @@ - - + + diff --git a/src/application/MainWindowController.java b/src/application/MainWindowController.java index c4d7998..14131af 100644 --- a/src/application/MainWindowController.java +++ b/src/application/MainWindowController.java @@ -104,7 +104,7 @@ public class MainWindowController { @FXML ScrollPane scrollPane; @FXML - private JFXButton menubtn; + private JFXButton menubtn; //TODO switch to hamburger menu @FXML private JFXButton playbtn; @FXML @@ -177,14 +177,14 @@ public class MainWindowController { @FXML private TableColumn dataNameEndColumn = new TableColumn<>("Datei Name mit Endung"); - private boolean menutrue = false; //saves the position of menubtn (opened or closed) + private boolean menutrue = false; //saves the position of menuBtn (opened or closed) private boolean settingstrue = false; private boolean streamingSettingsTrue = false; private boolean autoUpdate = false; static boolean firststart = false; private int hashA = -2055934614; private String version = "0.5.1"; - private String buildNumber = "121"; + private String buildNumber = "125"; private String versionName = "plasma cow"; private String buildURL = "https://raw.githubusercontent.com/Seil0/Project-HomeFlix/master/updates/buildNumber.txt"; private String downloadLink = "https://raw.githubusercontent.com/Seil0/Project-HomeFlix/master/updates/downloadLink.txt"; @@ -239,7 +239,7 @@ public class MainWindowController { ResourceBundle bundle; private ObservableList filterData = FXCollections.observableArrayList(); - private ObservableList locals = FXCollections.observableArrayList("english (en_US)", "deutsch (de_DE)"); + private ObservableList locals = FXCollections.observableArrayList("English (en_US)", "Deutsch (de_DE)"); ObservableList localFilms = FXCollections.observableArrayList(); ObservableList streamingFilms = FXCollections.observableArrayList(); ObservableList streamingData = FXCollections.observableArrayList(); @@ -514,7 +514,9 @@ private void streamingDirectoryBtnAction(){ } - //"Main" Method called in Main.java main() when starting + /**"Main" Method called in Main.java main() when starting + * Initialize other objects: Updater, dbController and ApiQuery + */ void setMain(Main main) { this.main = main; Updater = new updater(this,buildURL, downloadLink, buildNumber); @@ -531,7 +533,7 @@ void initTabel(){ columnTitel.setMaxWidth(260); columnStreamUrl.setMaxWidth(0); dataNameColumn.setPrefWidth(150); - dataNameEndColumn.setPrefWidth(170); + dataNameEndColumn.setPrefWidth(220); columnRating.setStyle("-fx-alignment: CENTER;"); treeTableViewfilm.setRoot(root); @@ -626,7 +628,7 @@ public void changed(ObservableValue observable,String oldValue cbLocal.getSelectionModel().selectedIndexProperty().addListener(new ChangeListener() { public void changed(ObservableValue ov, Number value, Number new_value) { String local = cbLocal.getItems().get((int) new_value).toString(); - local = local.substring(local.length()-6,local.length()-1); + local = local.substring(local.length()-6,local.length()-1); //reading only en_US from English (en_US) setLocal(local); setLocalUI(); saveSettings(); @@ -692,7 +694,7 @@ public void handle(ActionEvent event) { }); /** - * TODO fix bug when sort by ASCENDING, wrong order + * FIXME fix bug when sort by ASCENDING, wrong order */ columnRating.sortTypeProperty().addListener(new ChangeListener() { @Override @@ -923,7 +925,7 @@ private void sideMenuSlideOut(){ void setLocalUI(){ switch(getLocal()){ case "en_US": - bundle = ResourceBundle.getBundle("recources.HomeFlix-Local", Locale.US); //us_english + bundle = ResourceBundle.getBundle("recources.HomeFlix-Local", Locale.US); //us_English cbLocal.getSelectionModel().select(0); break; case "de_DE": @@ -1020,6 +1022,7 @@ void showErrorMsg(String msg, IOException exception){ //saves the Settings public void saveSettings(){ + System.out.println("saving settings ..."); OutputStream outputStream; //new output-stream try { props.setProperty("path", getPath()); //writes path into property @@ -1056,14 +1059,26 @@ public void loadSettings(){ inputStream = new FileInputStream(fileWin); } props.loadFromXML(inputStream); //new input-stream from .xml - path = props.getProperty("path"); //reads path from property + path = props.getProperty("path"); //read path from property streamingPath = props.getProperty("streamingPath"); color = props.getProperty("color"); size = Double.parseDouble(props.getProperty("size")); autoUpdate = Boolean.parseBoolean(props.getProperty("autoUpdate")); local = props.getProperty("local"); - mode = props.getProperty("mode"); ratingSortType = props.getProperty("ratingSortType"); + + switch (props.getProperty("mode")) { + case "local": + mode = "local"; + break; + case "streaming": + mode = "streaming"; + break; + default: + mode = "local"; + break; + } + inputStream.close(); } catch (IOException e) { if(firststart == false){ diff --git a/src/application/apiQuery.java b/src/application/apiQuery.java index b69efdf..0196a0c 100644 --- a/src/application/apiQuery.java +++ b/src/application/apiQuery.java @@ -38,15 +38,14 @@ public apiQuery(MainWindowController m, DBController db, Main main){ private Image im; private String[] responseString = new String[20]; private String posterCache; + private String apiURL = "https://www.omdbapi.com/?"; ArrayList responseText = new ArrayList(); ArrayList nameText = new ArrayList(); void startQuery(String titel, String streamUrl){ - URL url = null; + URL queryURL = null; Scanner sc = null; - String apiurl = "https://www.omdbapi.com/?"; //API URL String moviename = null; - String dataurl = null; String retdata = null; String posterPath = null; InputStream is = null; @@ -72,17 +71,15 @@ void startQuery(String titel, String streamUrl){ //remove unwanted blank moviename = moviename.trim(); - //replace blank with + for api-query + //replace blank with + moviename = moviename.replace(" ", "+"); - //URL wird zusammengestellt abfragetypen: http,json,xml (muss json sein um späteres trennen zu ermöglichen) - dataurl = apiurl + "t=" + moviename + "&plot=full&r=json"; - - url = new URL(dataurl); - is = url.openStream(); + //queryURL is apiURL and additional parameters, response-types: http,json,xml (must be json, since the response is processed with minimal-json ) + queryURL = new URL(apiURL + "t=" + moviename + "&plot=full&r=json"); + is = queryURL.openStream(); br = new BufferedReader(new InputStreamReader(is, "UTF-8")); - // read data from response Stream + //read data from response Stream while ((retdata = br.readLine()) != null) { //cut the json response into separate strings System.out.println(retdata); @@ -197,8 +194,8 @@ void startQuery(String titel, String streamUrl){ if (sc != null) { sc.close(); } - } catch (Exception e2) { - ; + } catch (Exception e) { + e.printStackTrace(); } } } diff --git a/src/application/updater.java b/src/application/updater.java index 32aa8c9..bab88d9 100644 --- a/src/application/updater.java +++ b/src/application/updater.java @@ -75,10 +75,7 @@ public void run(){ pm.setMillisToPopup(0); pm.setMinimum(0);// tell the progress bar that we start at the beginning of the stream pm.setMaximum(conn.getContentLength());// tell the progress bar the total number of bytes we are going to read. - FileUtils.copyInputStreamToFile(pmis, new File("ProjectHomeFlix.jar")); - - - //need to check if the old config file is compatible TODO + FileUtils.copyInputStreamToFile(pmis, new File("ProjectHomeFlix.jar")); Runtime.getRuntime().exec("java -jar ProjectHomeFlix.jar"); //start again System.exit(0); //finishes itself diff --git a/updates/ProjectHomeFlix.jar b/updates/ProjectHomeFlix.jar index b2974ab..0455025 100644 Binary files a/updates/ProjectHomeFlix.jar and b/updates/ProjectHomeFlix.jar differ diff --git a/updates/buildNumber.txt b/updates/buildNumber.txt index 5bc6609..d136d6a 100644 --- a/updates/buildNumber.txt +++ b/updates/buildNumber.txt @@ -1 +1 @@ -117 +125