Browse Source

clean up

*clean up and minor improvements
*increase build number to 125
pull/10/head 0.5.1
Seil0 5 years ago
parent
commit
96d0412919
  1. BIN
      bin/application/Main.class
  2. 4
      bin/application/MainWindow.fxml
  3. BIN
      bin/application/MainWindowController$1.class
  4. BIN
      bin/application/MainWindowController$2.class
  5. BIN
      bin/application/MainWindowController$3.class
  6. BIN
      bin/application/MainWindowController$4.class
  7. BIN
      bin/application/MainWindowController$5.class
  8. BIN
      bin/application/MainWindowController$6.class
  9. BIN
      bin/application/MainWindowController$7.class
  10. BIN
      bin/application/MainWindowController.class
  11. BIN
      bin/application/apiQuery.class
  12. BIN
      bin/application/updater.class
  13. 4
      src/application/DBController.java
  14. 4
      src/application/Main.java
  15. 4
      src/application/MainWindow.fxml
  16. 37
      src/application/MainWindowController.java
  17. 21
      src/application/apiQuery.java
  18. 5
      src/application/updater.java
  19. BIN
      updates/ProjectHomeFlix.jar
  20. 2
      updates/buildNumber.txt

BIN
bin/application/Main.class

Binary file not shown.

4
bin/application/MainWindow.fxml

@ -81,8 +81,8 @@
<AnchorPane fx:id="streamingSettingsAnchor" layoutX="138.0" layoutY="33.0" prefHeight="566.0" prefWidth="760.0" style="-fx-background-color: #FFFFFF;" visible="false" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="150.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="38.0">
<children>
<JFXTextField fx:id="tfStreamingPath" layoutX="14.0" layoutY="14.0" onAction="#tfStreamingPathAction" prefWidth="250.0" AnchorPane.leftAnchor="5.0" AnchorPane.topAnchor="5.0" />
<JFXButton fx:id="streamingDirectoryBtn" layoutX="263.0" layoutY="2.0" onAction="#streamingDirectoryBtnAction" AnchorPane.leftAnchor="260.0" AnchorPane.topAnchor="5.0" />
<TableView fx:id="tableViewStreamingdata" layoutX="14.0" layoutY="44.0" prefHeight="200.0" prefWidth="300.0" AnchorPane.bottomAnchor="5.0" AnchorPane.leftAnchor="5.0" AnchorPane.topAnchor="40.0" />
<JFXButton fx:id="streamingDirectoryBtn" layoutX="263.0" layoutY="2.0" onAction="#streamingDirectoryBtnAction" prefHeight="25.0" prefWidth="115.0" AnchorPane.leftAnchor="260.0" AnchorPane.topAnchor="5.0" />
<TableView fx:id="tableViewStreamingdata" layoutX="14.0" layoutY="44.0" prefHeight="517.0" prefWidth="370.0" AnchorPane.bottomAnchor="5.0" AnchorPane.leftAnchor="5.0" AnchorPane.topAnchor="40.0" />
</children></AnchorPane>
<AnchorPane fx:id="settingsAnchor" layoutX="160.0" layoutY="44.0" prefHeight="566.0" prefWidth="760.0" style="-fx-background-color: #FFFFFF;" visible="false" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="150.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="38.0">
<children>

BIN
bin/application/MainWindowController$1.class

Binary file not shown.

BIN
bin/application/MainWindowController$2.class

Binary file not shown.

BIN
bin/application/MainWindowController$3.class

Binary file not shown.

BIN
bin/application/MainWindowController$4.class

Binary file not shown.

BIN
bin/application/MainWindowController$5.class

Binary file not shown.

BIN
bin/application/MainWindowController$6.class

Binary file not shown.

BIN
bin/application/MainWindowController$7.class

Binary file not shown.

BIN
bin/application/MainWindowController.class

Binary file not shown.

BIN
bin/application/apiQuery.class

Binary file not shown.

BIN
bin/application/updater.class

Binary file not shown.

4
src/application/DBController.java

@ -245,7 +245,7 @@ public class DBController {
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 @@ public class DBController {
}
//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;

4
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 @@ public class Main extends Application {
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()) {

4
src/application/MainWindow.fxml

@ -81,8 +81,8 @@
<AnchorPane fx:id="streamingSettingsAnchor" layoutX="138.0" layoutY="33.0" prefHeight="566.0" prefWidth="760.0" style="-fx-background-color: #FFFFFF;" visible="false" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="150.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="38.0">
<children>
<JFXTextField fx:id="tfStreamingPath" layoutX="14.0" layoutY="14.0" onAction="#tfStreamingPathAction" prefWidth="250.0" AnchorPane.leftAnchor="5.0" AnchorPane.topAnchor="5.0" />
<JFXButton fx:id="streamingDirectoryBtn" layoutX="263.0" layoutY="2.0" onAction="#streamingDirectoryBtnAction" AnchorPane.leftAnchor="260.0" AnchorPane.topAnchor="5.0" />
<TableView fx:id="tableViewStreamingdata" layoutX="14.0" layoutY="44.0" prefHeight="200.0" prefWidth="300.0" AnchorPane.bottomAnchor="5.0" AnchorPane.leftAnchor="5.0" AnchorPane.topAnchor="40.0" />
<JFXButton fx:id="streamingDirectoryBtn" layoutX="263.0" layoutY="2.0" onAction="#streamingDirectoryBtnAction" prefHeight="25.0" prefWidth="115.0" AnchorPane.leftAnchor="260.0" AnchorPane.topAnchor="5.0" />
<TableView fx:id="tableViewStreamingdata" layoutX="14.0" layoutY="44.0" prefHeight="517.0" prefWidth="370.0" AnchorPane.bottomAnchor="5.0" AnchorPane.leftAnchor="5.0" AnchorPane.topAnchor="40.0" />
</children></AnchorPane>
<AnchorPane fx:id="settingsAnchor" layoutX="160.0" layoutY="44.0" prefHeight="566.0" prefWidth="760.0" style="-fx-background-color: #FFFFFF;" visible="false" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="150.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="38.0">
<children>

37
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<tableData, String> 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<tableData> filterData = FXCollections.observableArrayList();
private ObservableList<String> locals = FXCollections.observableArrayList("english (en_US)", "deutsch (de_DE)");
private ObservableList<String> locals = FXCollections.observableArrayList("English (en_US)", "Deutsch (de_DE)");
ObservableList<tableData> localFilms = FXCollections.observableArrayList();
ObservableList<tableData> streamingFilms = FXCollections.observableArrayList();
ObservableList<tableData> streamingData = FXCollections.observableArrayList();
@ -514,7 +514,9 @@ public class MainWindowController {
}
//"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 @@ public class MainWindowController {
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 class MainWindowController {
cbLocal.getSelectionModel().selectedIndexProperty().addListener(new ChangeListener<Number>() {
public void changed(ObservableValue<? extends Number> 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 class MainWindowController {
});
/**
* TODO fix bug when sort by ASCENDING, wrong order
* FIXME fix bug when sort by ASCENDING, wrong order
*/
columnRating.sortTypeProperty().addListener(new ChangeListener<SortType>() {
@Override
@ -923,7 +925,7 @@ public class MainWindowController {
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 @@ public class MainWindowController {
//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 class MainWindowController {
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){

21
src/application/apiQuery.java

@ -38,15 +38,14 @@ public class apiQuery{
private Image im;
private String[] responseString = new String[20];
private String posterCache;
private String apiURL = "https://www.omdbapi.com/?";
ArrayList<Text> responseText = new ArrayList<Text>();
ArrayList<Text> nameText = new ArrayList<Text>();
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 @@ public class apiQuery{
//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 @@ public class apiQuery{
if (sc != null) {
sc.close();
}
} catch (Exception e2) {
;
} catch (Exception e) {
e.printStackTrace();
}
}
}

5
src/application/updater.java

@ -75,10 +75,7 @@ public class updater extends Thread{
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

BIN
updates/ProjectHomeFlix.jar

Binary file not shown.

2
updates/buildNumber.txt

@ -1 +1 @@
117
125

Loading…
Cancel
Save

Du besuchst diese Seite mit einem veralteten IPv4-Internetzugang. Möglicherweise treten in Zukunft Probleme mit der Erreichbarkeit und Performance auf. Bitte frage deinen Internetanbieter oder Netzwerkadministrator nach IPv6-Unterstützung.
You are visiting this site with an outdated IPv4 internet access. You may experience problems with accessibility and performance in the future. Please ask your ISP or network administrator for IPv6 support.
Weitere Infos | More Information
Klicke zum schließen | Click to close