Compare commits
95 Commits
Author | SHA1 | Date | |
---|---|---|---|
96d0412919 | |||
8786b8edef | |||
853daafe34 | |||
d8383b98d6 | |||
cccbca06bd | |||
726a788876 | |||
10a640a34c | |||
32e5d829cc | |||
df448e321d | |||
4d3c402553 | |||
0f5d0b859f | |||
131c8a491b | |||
d91ef3aeac | |||
bef90522ca | |||
8dcb737e4d | |||
6524b3e139 | |||
0cf8905125 | |||
c49714f641 | |||
16d324fdf1 | |||
8029d4294f | |||
01372c6ad3 | |||
e88e7087ac | |||
03debb4180 | |||
9316bd9982 | |||
7890468c20 | |||
1801723bdb | |||
5dbf5278c9 | |||
b5a426dbde | |||
4d4dc05d45 | |||
e9527b0ac2 | |||
3a73d84bfb | |||
93822bb013 | |||
15009a1047 | |||
e7b685ef82 | |||
c20f6917b1 | |||
dbcf1331ba | |||
4892abc2bd | |||
e71db85b7d | |||
d736e2eef0 | |||
3e2443ce5c | |||
d809b1ff9b | |||
5fb7947cc8 | |||
b8a4727c93 | |||
979b703da1 | |||
45ab740310 | |||
679a5306f5 | |||
d1c65c369b | |||
4fe2d7b4be | |||
e63665add0 | |||
a8e2f589ab | |||
77f37955ae | |||
f4e2fd2234 | |||
7a92bb452f | |||
9aa36fc622 | |||
b5035825a5 | |||
686a88daa0 | |||
976c1f7ef8 | |||
98a493aba6 | |||
aacd1ed47b | |||
58ec9b4e9e | |||
05d6bb0862 | |||
65c4871c46 | |||
c23d5f4905 | |||
1645cda489 | |||
56feef8935 | |||
1077ff304a | |||
684fb45df4 | |||
44f4fc7481 | |||
cccff67399 | |||
83de2423e5 | |||
c8fd267159 | |||
42f13f37b0 | |||
985ca4c8fe | |||
20e8215055 | |||
84b7e2b7a1 | |||
9de3e6a3f1 | |||
c6a78bb345 | |||
fa252a916c | |||
4d57bdbdff | |||
d0be4f88b0 | |||
cf1350033f | |||
9876ad6212 | |||
a664a9c5c4 | |||
810b4ee957 | |||
026dde43d8 | |||
cac744ce21 | |||
08099488a8 | |||
30aa11efc2 | |||
d425896e87 | |||
596a29c5cd | |||
ee86c9be48 | |||
6304c01b9d | |||
ecceb9010e | |||
b50b1d547d | |||
2c1c39c9d1 |
@ -3,7 +3,9 @@
|
|||||||
<classpathentry kind="src" path="src"/>
|
<classpathentry kind="src" path="src"/>
|
||||||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
|
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
|
||||||
<classpathentry kind="con" path="org.eclipse.fx.ide.jdt.core.JAVAFX_CONTAINER"/>
|
<classpathentry kind="con" path="org.eclipse.fx.ide.jdt.core.JAVAFX_CONTAINER"/>
|
||||||
<classpathentry kind="lib" path="C:/Users/Jannik/workspace/Project HomeFlix/jfoenix.jar"/>
|
<classpathentry kind="lib" path="src/libraries/minimal-json-0.9.4.jar"/>
|
||||||
<classpathentry kind="lib" path="C:/Users/Jannik/workspace/Project HomeFlix/minimal-json-0.9.4.jar"/>
|
<classpathentry kind="lib" path="src/libraries/sqlite-jdbc-3.16.1.jar"/>
|
||||||
|
<classpathentry kind="lib" path="src/libraries/jfoenix-1.3.0.jar"/>
|
||||||
|
<classpathentry kind="lib" path="src/libraries/commons-io-2.5.jar"/>
|
||||||
<classpathentry kind="output" path="bin"/>
|
<classpathentry kind="output" path="bin"/>
|
||||||
</classpath>
|
</classpath>
|
||||||
|
3
.directory
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
[Dolphin]
|
||||||
|
Timestamp=2016,8,15,12,18,4
|
||||||
|
Version=3
|
3
.gitignore
vendored
@ -45,7 +45,6 @@ $RECYCLE.BIN/
|
|||||||
Network Trash Folder
|
Network Trash Folder
|
||||||
Temporary Items
|
Temporary Items
|
||||||
.apdisk
|
.apdisk
|
||||||
jfoenix.jar
|
|
||||||
minimal-json-0.9.4.jar
|
|
||||||
config.xml
|
config.xml
|
||||||
|
.directory
|
||||||
|
|
||||||
|
1
.project
@ -19,5 +19,6 @@
|
|||||||
<natures>
|
<natures>
|
||||||
<nature>org.eclipse.xtext.ui.shared.xtextNature</nature>
|
<nature>org.eclipse.xtext.ui.shared.xtextNature</nature>
|
||||||
<nature>org.eclipse.jdt.core.javanature</nature>
|
<nature>org.eclipse.jdt.core.javanature</nature>
|
||||||
|
<nature>org.eclipse.fx.ide.css.nature</nature>
|
||||||
</natures>
|
</natures>
|
||||||
</projectDescription>
|
</projectDescription>
|
||||||
|
23
README.md
@ -1,24 +1,17 @@
|
|||||||
# Project-HomeFlix
|
# Project-HomeFlix
|
||||||
|
|
||||||
Project HomeFlix is a Kellerkinder Project. More Information soon ...
|
|
||||||
|
Project HomeFlix is a Kellerkinder Project, that alowes you to sort all your local saved movies in clean UI.
|
||||||
|
The dev branch is **only merged** into master when a **new release** is released. Please commit all changes to [dev](https://github.com/Seil0/Project-HomeFlix/tree/dev).
|
||||||
|
|
||||||
Librarys used in this Project:
|
Librarys used in this Project:
|
||||||
JFoenix https://github.com/jfoenixadmin/JFoenix
|
JFoenix: https://github.com/jfoenixadmin/JFoenix
|
||||||
minimal-json https://github.com/ralfstx/minimal-json
|
minimal-json: https://github.com/ralfstx/minimal-json
|
||||||
|
sqlite-jdbc: https://github.com/xerial/sqlite-jdbc
|
||||||
|
|
||||||
## Installation
|
## Installation
|
||||||
|
|
||||||
download compiled .jar
|
[wiki](https://github.com/Seil0/Project-HomeFlix/wiki)
|
||||||
|
|
||||||
##FAQ
|
Project HomeFlix © 2016-2017 Kellerkinder ([Seil0](https://github.com/Seil0), [Windoofs](https://github.com/Windoofs))
|
||||||
- HomeFlix isn't starting after update
|
|
||||||
- delete the config.xml file and start HomeFlix again
|
|
||||||
- can't choos a main color
|
|
||||||
- restart HomeFlix
|
|
||||||
- HomeFlix hangs or dosen't responde
|
|
||||||
- try restarting it and check the movie names
|
|
||||||
- cann't start HomeFlix under Linux
|
|
||||||
- check your Java version. Java 8 update 91 is required
|
|
||||||
|
|
||||||
Project HomeFlix © 2016 Software Development Kellerkinder (SDK)
|
|
||||||
www.kellerkinder.xyz
|
www.kellerkinder.xyz
|
||||||
|
1
bin/.gitignore
vendored
Normal file
@ -0,0 +1 @@
|
|||||||
|
/application/
|
@ -1,16 +0,0 @@
|
|||||||
# HomeFlix-Local_de_DE.properties German Local
|
|
||||||
info = Info
|
|
||||||
settings = Einstellungen
|
|
||||||
play = play
|
|
||||||
openFolder = Ordner \u00F6ffnen
|
|
||||||
chooseFolder = Ordner ausw\u00E4hlen
|
|
||||||
fontSize = Schriftgr\u00F6\u00DFe:
|
|
||||||
checkUpdates = Auf Update pr\u00FCfen
|
|
||||||
autoUpdate = beim Start nach Updates suchen:
|
|
||||||
version = Version:
|
|
||||||
columnName = Name
|
|
||||||
columnRating = Bewertung
|
|
||||||
columnDatName = Datei Name
|
|
||||||
errorUpdateV = Beim ausf\u00FChren des Updates ist ein Fehler aufgetreten! \nError: could not check update version (nvc)\nWeitere Hilfe erhalten sie unter www.kellerkinder.xyz \noder wenden sie sich an support@kellerkinder.xyz
|
|
||||||
errorUpdateD = Beim ausf\u00FChren des Updates ist ein Fehler aufgetreten! \nError: could not download update files (ndf)\nWeitere Hilfe erhalten sie unter www.kellerkinder.xyz \noder wenden sie sich an support@kellerkinder.xyz
|
|
||||||
infoText = \nMaintainer: seilo@kellerkinder.xyz und \nhendrik.schutter@coptersicht.de \n(c) 2016 Kellerkinder www.kellerkinder.xyz
|
|
@ -1,16 +0,0 @@
|
|||||||
# HomeFlix-Local_en_US.properties US-English Local and default
|
|
||||||
info = Info
|
|
||||||
settings = Settings
|
|
||||||
play = play
|
|
||||||
openFolder = open Folder
|
|
||||||
chooseFolder = choose Directory
|
|
||||||
fontSize = font size:
|
|
||||||
checkUpdates = check for updates
|
|
||||||
autoUpdate = check at startup for updates:
|
|
||||||
version = Version:
|
|
||||||
columnName = Name
|
|
||||||
columnRating = Rating
|
|
||||||
columnDatName = File Name
|
|
||||||
errorUpdateV = An error has occurred during update! \nError: could not check update version (nvc) \nTo get help, visit www.kellerkinder.xyz \nor contcat support@kellerkinder.xyz
|
|
||||||
errorUpdateD = An error has occurred during update! \nError: could not download update files (ndf) \nTo get help, visit www.kellerkinder.xyz \nor contcat support@kellerkinder.xyz
|
|
||||||
infoText = \nMaintainer: seilo@kellerkinder.xyz and \nhendrik.schutter@coptersicht.de \n(c) 2016 Kellerkinder www.kellerkinder.xyz
|
|
@ -1,24 +1,32 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
|
||||||
<?import com.jfoenix.controls.JFXButton?>
|
<?import com.jfoenix.controls.JFXButton?>
|
||||||
<?import com.jfoenix.controls.JFXTextArea?>
|
<?import com.jfoenix.controls.JFXColorPicker?>
|
||||||
|
<?import com.jfoenix.controls.JFXSlider?>
|
||||||
<?import com.jfoenix.controls.JFXTextField?>
|
<?import com.jfoenix.controls.JFXTextField?>
|
||||||
|
<?import com.jfoenix.controls.JFXToggleButton?>
|
||||||
|
<?import javafx.scene.control.ChoiceBox?>
|
||||||
|
<?import javafx.scene.control.Label?>
|
||||||
|
<?import javafx.scene.control.ScrollPane?>
|
||||||
|
<?import javafx.scene.control.TableView?>
|
||||||
<?import javafx.scene.control.TreeTableView?>
|
<?import javafx.scene.control.TreeTableView?>
|
||||||
|
<?import javafx.scene.image.Image?>
|
||||||
<?import javafx.scene.image.ImageView?>
|
<?import javafx.scene.image.ImageView?>
|
||||||
<?import javafx.scene.layout.AnchorPane?>
|
<?import javafx.scene.layout.AnchorPane?>
|
||||||
|
<?import javafx.scene.layout.HBox?>
|
||||||
<?import javafx.scene.layout.VBox?>
|
<?import javafx.scene.layout.VBox?>
|
||||||
<?import javafx.scene.text.Font?>
|
<?import javafx.scene.text.Font?>
|
||||||
|
<?import javafx.scene.text.TextFlow?>
|
||||||
|
|
||||||
<AnchorPane fx:id="anpane" prefHeight="600.0" prefWidth="900.0" xmlns="http://javafx.com/javafx/8.0.60" xmlns:fx="http://javafx.com/fxml/1" fx:controller="application.MainWindowController">
|
<AnchorPane fx:id="anpane" prefHeight="600.0" prefWidth="950.0" xmlns="http://javafx.com/javafx/8.0.111" xmlns:fx="http://javafx.com/fxml/1" fx:controller="application.MainWindowController">
|
||||||
<children>
|
<children>
|
||||||
<VBox fx:id="topVBox" prefHeight="32.0" prefWidth="800.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0">
|
<ScrollPane fx:id="scrollPane" fitToWidth="true" layoutX="408.0" layoutY="44.0" prefHeight="544.0" prefWidth="320.0" AnchorPane.bottomAnchor="12.0" AnchorPane.leftAnchor="408.0" AnchorPane.rightAnchor="222.0" AnchorPane.topAnchor="44.0">
|
||||||
<children>
|
<content>
|
||||||
<JFXButton fx:id="menubtn" onAction="#menubtnclicked" prefHeight="32.0" prefWidth="67.0" text="Menu" />
|
<TextFlow fx:id="textFlow" accessibleRole="TEXT_AREA" maxHeight="544.0" maxWidth="320.0" visible="true" />
|
||||||
</children>
|
</content>
|
||||||
</VBox>
|
</ScrollPane>
|
||||||
<TreeTableView fx:id="treeTableViewfilm" layoutX="14.0" layoutY="88.0" prefHeight="400.0" prefWidth="360.0" AnchorPane.bottomAnchor="12.0" AnchorPane.leftAnchor="12.0" AnchorPane.topAnchor="88.0" />
|
<TreeTableView fx:id="treeTableViewfilm" layoutX="14.0" layoutY="88.0" prefHeight="500.0" prefWidth="375.0" AnchorPane.bottomAnchor="12.0" AnchorPane.leftAnchor="12.0" AnchorPane.rightAnchor="568.0" AnchorPane.topAnchor="88.0" />
|
||||||
<JFXTextArea fx:id="ta1" layoutX="385.0" layoutY="42.0" maxWidth="503.0" minWidth="275.0" prefHeight="546.0" prefWidth="293.0" AnchorPane.bottomAnchor="12.0" AnchorPane.leftAnchor="385.0" AnchorPane.rightAnchor="222.0" AnchorPane.topAnchor="44.0" />
|
<JFXButton fx:id="playbtn" contentDisplay="CENTER" layoutX="690.0" layoutY="363.0" onAction="#playbtnclicked" prefHeight="25.0" prefWidth="198.0" AnchorPane.bottomAnchor="212.0" AnchorPane.rightAnchor="12.0">
|
||||||
<JFXButton fx:id="playbtn" layoutX="690.0" layoutY="363.0" onAction="#playbtnclicked" prefHeight="25.0" prefWidth="198.0" text="play" AnchorPane.bottomAnchor="212.0" AnchorPane.rightAnchor="12.0">
|
|
||||||
<font>
|
<font>
|
||||||
<Font name="System Bold" size="14.0" />
|
<Font name="System Bold" size="14.0" />
|
||||||
</font></JFXButton>
|
</font></JFXButton>
|
||||||
@ -26,12 +34,69 @@
|
|||||||
<font>
|
<font>
|
||||||
<Font name="System Bold" size="14.0" />
|
<Font name="System Bold" size="14.0" />
|
||||||
</font></JFXButton>
|
</font></JFXButton>
|
||||||
<JFXTextField fx:id="tfsearch" layoutX="12.0" layoutY="44.0" maxWidth="477.0" minWidth="359.0" prefHeight="31.0" prefWidth="359.0" promptText="Suche ..." AnchorPane.leftAnchor="12.0" AnchorPane.topAnchor="44.0">
|
<JFXTextField fx:id="tfsearch" layoutX="12.0" layoutY="44.0" maxWidth="477.0" minWidth="359.0" prefHeight="31.0" prefWidth="370.0" promptText="Suche ..." AnchorPane.leftAnchor="12.0" AnchorPane.rightAnchor="568.0" AnchorPane.topAnchor="44.0">
|
||||||
<font>
|
<font>
|
||||||
<Font name="Arial" size="12.0" />
|
<Font name="Arial" size="12.0" />
|
||||||
</font></JFXTextField>
|
</font></JFXTextField>
|
||||||
<ImageView fx:id="image1" fitHeight="297.0" fitWidth="198.0" layoutX="481.0" layoutY="46.0" pickOnBounds="true" preserveRatio="true" AnchorPane.rightAnchor="12.0" AnchorPane.topAnchor="44.0" />
|
<ImageView fx:id="image1" fitHeight="297.0" fitWidth="198.0" layoutX="481.0" layoutY="46.0" pickOnBounds="true" preserveRatio="true" AnchorPane.rightAnchor="12.0" AnchorPane.topAnchor="44.0">
|
||||||
<JFXButton fx:id="returnBtn" layoutX="690.0" layoutY="443.0" onAction="#returnBtnclicked" prefHeight="25.0" prefWidth="90.0" text="<<" AnchorPane.bottomAnchor="132.0" AnchorPane.rightAnchor="120.0" />
|
<image>
|
||||||
<JFXButton fx:id="forwardBtn" layoutX="798.0" layoutY="443.0" onAction="#forwardBtnclicked" prefHeight="25.0" prefWidth="90.0" text=">>" AnchorPane.bottomAnchor="132.0" AnchorPane.rightAnchor="12.0" />
|
<Image url="@../recources/Homeflix_Poster.png" />
|
||||||
|
</image></ImageView>
|
||||||
|
<JFXButton fx:id="returnBtn" contentDisplay="CENTER" layoutX="690.0" layoutY="443.0" onAction="#returnBtnclicked" prefHeight="25.0" prefWidth="90.0" AnchorPane.bottomAnchor="132.0" AnchorPane.rightAnchor="120.0" />
|
||||||
|
<JFXButton fx:id="forwardBtn" contentDisplay="CENTER" layoutX="798.0" layoutY="443.0" onAction="#forwardBtnclicked" prefHeight="25.0" prefWidth="90.0" AnchorPane.bottomAnchor="132.0" AnchorPane.rightAnchor="12.0" />
|
||||||
|
<HBox fx:id="topHBox" layoutY="12.0" prefHeight="32.0" prefWidth="900.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0">
|
||||||
|
<children>
|
||||||
|
<JFXButton fx:id="menubtn" onAction="#menubtnclicked" prefHeight="32.0" prefWidth="32.0" />
|
||||||
|
</children>
|
||||||
|
</HBox>
|
||||||
|
<VBox fx:id="sideMenuVBox" layoutY="32.0" prefHeight="660.0" prefWidth="150.0" visible="false" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.topAnchor="38.0">
|
||||||
|
<children>
|
||||||
|
<JFXButton fx:id="infoBtn" onAction="#infoBtnclicked" prefHeight="32.0" prefWidth="150.0" textAlignment="CENTER">
|
||||||
|
<font>
|
||||||
|
<Font name="System Bold" size="15.0" />
|
||||||
|
</font>
|
||||||
|
</JFXButton>
|
||||||
|
<JFXButton fx:id="settingsBtn" onAction="#settingsBtnclicked" prefHeight="37.0" prefWidth="150.0" textAlignment="CENTER">
|
||||||
|
<font>
|
||||||
|
<Font name="System Bold" size="15.0" />
|
||||||
|
</font>
|
||||||
|
</JFXButton>
|
||||||
|
<JFXButton fx:id="streamingSettingsBtn" onAction="#streamingSettingsBtnclicked" prefHeight="32.0" prefWidth="150.0" textAlignment="CENTER">
|
||||||
|
<font>
|
||||||
|
<Font name="System Bold" size="15.0" />
|
||||||
|
</font>
|
||||||
|
</JFXButton>
|
||||||
|
<JFXButton fx:id="switchBtn" onAction="#switchBtnclicked" prefHeight="32.0" prefWidth="150.0" textAlignment="CENTER">
|
||||||
|
<font>
|
||||||
|
<Font name="System Bold" size="15.0" />
|
||||||
|
</font>
|
||||||
|
</JFXButton>
|
||||||
|
<JFXButton fx:id="debugBtn" onAction="#debugBtnclicked" prefHeight="32.0" prefWidth="150.0" text="debugging" textAlignment="CENTER">
|
||||||
|
<font>
|
||||||
|
<Font name="System Bold" size="15.0" />
|
||||||
|
</font>
|
||||||
|
</JFXButton>
|
||||||
|
</children>
|
||||||
|
</VBox>
|
||||||
|
<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" 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>
|
||||||
|
<JFXTextField fx:id="tfPath" layoutX="14.0" layoutY="14.0" onAction="#tfPathAction" prefWidth="250.0" AnchorPane.leftAnchor="5.0" AnchorPane.topAnchor="5.0" />
|
||||||
|
<JFXButton fx:id="directoryBtn" layoutX="255.0" layoutY="8.0" onAction="#directoryBtnAction" prefHeight="25.0" AnchorPane.leftAnchor="260.0" />
|
||||||
|
<JFXColorPicker fx:id="mainColor" layoutX="14.0" layoutY="45.0" onAction="#mainColorAction" AnchorPane.leftAnchor="5.0" AnchorPane.topAnchor="40.0" />
|
||||||
|
<Label fx:id="sizelbl" layoutY="73.0" text="Label" AnchorPane.leftAnchor="5.0" AnchorPane.topAnchor="75.0" />
|
||||||
|
<JFXSlider fx:id="sliderFontSize" layoutX="10.0" layoutY="99.0" max="48.0" min="2.0" prefWidth="250.0" AnchorPane.leftAnchor="5.0" AnchorPane.topAnchor="110.0" />
|
||||||
|
<ChoiceBox fx:id="cbLocal" layoutX="14.0" layoutY="131.0" prefWidth="150.0" AnchorPane.leftAnchor="5.0" AnchorPane.topAnchor="145.0" />
|
||||||
|
<JFXButton fx:id="updateBtn" layoutX="7.0" layoutY="177.0" onAction="#updateBtnAction" AnchorPane.leftAnchor="5.0" AnchorPane.topAnchor="180.0" />
|
||||||
|
<Label fx:id="aulbl" layoutX="43.0" layoutY="219.0" text="Label" AnchorPane.leftAnchor="5.0" AnchorPane.topAnchor="215.0" />
|
||||||
|
<JFXToggleButton fx:id="autoupdateBtn" layoutX="19.0" layoutY="215.0" onAction="#autoupdateBtnAction" AnchorPane.leftAnchor="5.0" AnchorPane.topAnchor="230.0" />
|
||||||
|
<Label fx:id="versionlbl" layoutX="29.0" layoutY="297.0" text="Label" AnchorPane.leftAnchor="5.0" AnchorPane.topAnchor="280.0" />
|
||||||
|
</children>
|
||||||
|
</AnchorPane>
|
||||||
</children>
|
</children>
|
||||||
</AnchorPane>
|
</AnchorPane>
|
||||||
|
BIN
bin/application/MainWindowController$7.class
Normal file
BIN
bin/application/apiQuery.class
Normal file
BIN
bin/application/tableData.class
Normal file
BIN
bin/application/updater.class
Normal file
202
bin/libraries/Licenses/Apache_License.txt
Normal file
@ -0,0 +1,202 @@
|
|||||||
|
|
||||||
|
Apache License
|
||||||
|
Version 2.0, January 2004
|
||||||
|
http://www.apache.org/licenses/
|
||||||
|
|
||||||
|
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
||||||
|
|
||||||
|
1. Definitions.
|
||||||
|
|
||||||
|
"License" shall mean the terms and conditions for use, reproduction,
|
||||||
|
and distribution as defined by Sections 1 through 9 of this document.
|
||||||
|
|
||||||
|
"Licensor" shall mean the copyright owner or entity authorized by
|
||||||
|
the copyright owner that is granting the License.
|
||||||
|
|
||||||
|
"Legal Entity" shall mean the union of the acting entity and all
|
||||||
|
other entities that control, are controlled by, or are under common
|
||||||
|
control with that entity. For the purposes of this definition,
|
||||||
|
"control" means (i) the power, direct or indirect, to cause the
|
||||||
|
direction or management of such entity, whether by contract or
|
||||||
|
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
||||||
|
outstanding shares, or (iii) beneficial ownership of such entity.
|
||||||
|
|
||||||
|
"You" (or "Your") shall mean an individual or Legal Entity
|
||||||
|
exercising permissions granted by this License.
|
||||||
|
|
||||||
|
"Source" form shall mean the preferred form for making modifications,
|
||||||
|
including but not limited to software source code, documentation
|
||||||
|
source, and configuration files.
|
||||||
|
|
||||||
|
"Object" form shall mean any form resulting from mechanical
|
||||||
|
transformation or translation of a Source form, including but
|
||||||
|
not limited to compiled object code, generated documentation,
|
||||||
|
and conversions to other media types.
|
||||||
|
|
||||||
|
"Work" shall mean the work of authorship, whether in Source or
|
||||||
|
Object form, made available under the License, as indicated by a
|
||||||
|
copyright notice that is included in or attached to the work
|
||||||
|
(an example is provided in the Appendix below).
|
||||||
|
|
||||||
|
"Derivative Works" shall mean any work, whether in Source or Object
|
||||||
|
form, that is based on (or derived from) the Work and for which the
|
||||||
|
editorial revisions, annotations, elaborations, or other modifications
|
||||||
|
represent, as a whole, an original work of authorship. For the purposes
|
||||||
|
of this License, Derivative Works shall not include works that remain
|
||||||
|
separable from, or merely link (or bind by name) to the interfaces of,
|
||||||
|
the Work and Derivative Works thereof.
|
||||||
|
|
||||||
|
"Contribution" shall mean any work of authorship, including
|
||||||
|
the original version of the Work and any modifications or additions
|
||||||
|
to that Work or Derivative Works thereof, that is intentionally
|
||||||
|
submitted to Licensor for inclusion in the Work by the copyright owner
|
||||||
|
or by an individual or Legal Entity authorized to submit on behalf of
|
||||||
|
the copyright owner. For the purposes of this definition, "submitted"
|
||||||
|
means any form of electronic, verbal, or written communication sent
|
||||||
|
to the Licensor or its representatives, including but not limited to
|
||||||
|
communication on electronic mailing lists, source code control systems,
|
||||||
|
and issue tracking systems that are managed by, or on behalf of, the
|
||||||
|
Licensor for the purpose of discussing and improving the Work, but
|
||||||
|
excluding communication that is conspicuously marked or otherwise
|
||||||
|
designated in writing by the copyright owner as "Not a Contribution."
|
||||||
|
|
||||||
|
"Contributor" shall mean Licensor and any individual or Legal Entity
|
||||||
|
on behalf of whom a Contribution has been received by Licensor and
|
||||||
|
subsequently incorporated within the Work.
|
||||||
|
|
||||||
|
2. Grant of Copyright License. Subject to the terms and conditions of
|
||||||
|
this License, each Contributor hereby grants to You a perpetual,
|
||||||
|
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||||
|
copyright license to reproduce, prepare Derivative Works of,
|
||||||
|
publicly display, publicly perform, sublicense, and distribute the
|
||||||
|
Work and such Derivative Works in Source or Object form.
|
||||||
|
|
||||||
|
3. Grant of Patent License. Subject to the terms and conditions of
|
||||||
|
this License, each Contributor hereby grants to You a perpetual,
|
||||||
|
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||||
|
(except as stated in this section) patent license to make, have made,
|
||||||
|
use, offer to sell, sell, import, and otherwise transfer the Work,
|
||||||
|
where such license applies only to those patent claims licensable
|
||||||
|
by such Contributor that are necessarily infringed by their
|
||||||
|
Contribution(s) alone or by combination of their Contribution(s)
|
||||||
|
with the Work to which such Contribution(s) was submitted. If You
|
||||||
|
institute patent litigation against any entity (including a
|
||||||
|
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
||||||
|
or a Contribution incorporated within the Work constitutes direct
|
||||||
|
or contributory patent infringement, then any patent licenses
|
||||||
|
granted to You under this License for that Work shall terminate
|
||||||
|
as of the date such litigation is filed.
|
||||||
|
|
||||||
|
4. Redistribution. You may reproduce and distribute copies of the
|
||||||
|
Work or Derivative Works thereof in any medium, with or without
|
||||||
|
modifications, and in Source or Object form, provided that You
|
||||||
|
meet the following conditions:
|
||||||
|
|
||||||
|
(a) You must give any other recipients of the Work or
|
||||||
|
Derivative Works a copy of this License; and
|
||||||
|
|
||||||
|
(b) You must cause any modified files to carry prominent notices
|
||||||
|
stating that You changed the files; and
|
||||||
|
|
||||||
|
(c) You must retain, in the Source form of any Derivative Works
|
||||||
|
that You distribute, all copyright, patent, trademark, and
|
||||||
|
attribution notices from the Source form of the Work,
|
||||||
|
excluding those notices that do not pertain to any part of
|
||||||
|
the Derivative Works; and
|
||||||
|
|
||||||
|
(d) If the Work includes a "NOTICE" text file as part of its
|
||||||
|
distribution, then any Derivative Works that You distribute must
|
||||||
|
include a readable copy of the attribution notices contained
|
||||||
|
within such NOTICE file, excluding those notices that do not
|
||||||
|
pertain to any part of the Derivative Works, in at least one
|
||||||
|
of the following places: within a NOTICE text file distributed
|
||||||
|
as part of the Derivative Works; within the Source form or
|
||||||
|
documentation, if provided along with the Derivative Works; or,
|
||||||
|
within a display generated by the Derivative Works, if and
|
||||||
|
wherever such third-party notices normally appear. The contents
|
||||||
|
of the NOTICE file are for informational purposes only and
|
||||||
|
do not modify the License. You may add Your own attribution
|
||||||
|
notices within Derivative Works that You distribute, alongside
|
||||||
|
or as an addendum to the NOTICE text from the Work, provided
|
||||||
|
that such additional attribution notices cannot be construed
|
||||||
|
as modifying the License.
|
||||||
|
|
||||||
|
You may add Your own copyright statement to Your modifications and
|
||||||
|
may provide additional or different license terms and conditions
|
||||||
|
for use, reproduction, or distribution of Your modifications, or
|
||||||
|
for any such Derivative Works as a whole, provided Your use,
|
||||||
|
reproduction, and distribution of the Work otherwise complies with
|
||||||
|
the conditions stated in this License.
|
||||||
|
|
||||||
|
5. Submission of Contributions. Unless You explicitly state otherwise,
|
||||||
|
any Contribution intentionally submitted for inclusion in the Work
|
||||||
|
by You to the Licensor shall be under the terms and conditions of
|
||||||
|
this License, without any additional terms or conditions.
|
||||||
|
Notwithstanding the above, nothing herein shall supersede or modify
|
||||||
|
the terms of any separate license agreement you may have executed
|
||||||
|
with Licensor regarding such Contributions.
|
||||||
|
|
||||||
|
6. Trademarks. This License does not grant permission to use the trade
|
||||||
|
names, trademarks, service marks, or product names of the Licensor,
|
||||||
|
except as required for reasonable and customary use in describing the
|
||||||
|
origin of the Work and reproducing the content of the NOTICE file.
|
||||||
|
|
||||||
|
7. Disclaimer of Warranty. Unless required by applicable law or
|
||||||
|
agreed to in writing, Licensor provides the Work (and each
|
||||||
|
Contributor provides its Contributions) on an "AS IS" BASIS,
|
||||||
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||||
|
implied, including, without limitation, any warranties or conditions
|
||||||
|
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
||||||
|
PARTICULAR PURPOSE. You are solely responsible for determining the
|
||||||
|
appropriateness of using or redistributing the Work and assume any
|
||||||
|
risks associated with Your exercise of permissions under this License.
|
||||||
|
|
||||||
|
8. Limitation of Liability. In no event and under no legal theory,
|
||||||
|
whether in tort (including negligence), contract, or otherwise,
|
||||||
|
unless required by applicable law (such as deliberate and grossly
|
||||||
|
negligent acts) or agreed to in writing, shall any Contributor be
|
||||||
|
liable to You for damages, including any direct, indirect, special,
|
||||||
|
incidental, or consequential damages of any character arising as a
|
||||||
|
result of this License or out of the use or inability to use the
|
||||||
|
Work (including but not limited to damages for loss of goodwill,
|
||||||
|
work stoppage, computer failure or malfunction, or any and all
|
||||||
|
other commercial damages or losses), even if such Contributor
|
||||||
|
has been advised of the possibility of such damages.
|
||||||
|
|
||||||
|
9. Accepting Warranty or Additional Liability. While redistributing
|
||||||
|
the Work or Derivative Works thereof, You may choose to offer,
|
||||||
|
and charge a fee for, acceptance of support, warranty, indemnity,
|
||||||
|
or other liability obligations and/or rights consistent with this
|
||||||
|
License. However, in accepting such obligations, You may act only
|
||||||
|
on Your own behalf and on Your sole responsibility, not on behalf
|
||||||
|
of any other Contributor, and only if You agree to indemnify,
|
||||||
|
defend, and hold each Contributor harmless for any liability
|
||||||
|
incurred by, or claims asserted against, such Contributor by reason
|
||||||
|
of your accepting any such warranty or additional liability.
|
||||||
|
|
||||||
|
END OF TERMS AND CONDITIONS
|
||||||
|
|
||||||
|
APPENDIX: How to apply the Apache License to your work.
|
||||||
|
|
||||||
|
To apply the Apache License to your work, attach the following
|
||||||
|
boilerplate notice, with the fields enclosed by brackets "[]"
|
||||||
|
replaced with your own identifying information. (Don't include
|
||||||
|
the brackets!) The text should be enclosed in the appropriate
|
||||||
|
comment syntax for the file format. We also recommend that a
|
||||||
|
file or class name and description of purpose be included on the
|
||||||
|
same "printed page" as the copyright notice for easier
|
||||||
|
identification within third-party archives.
|
||||||
|
|
||||||
|
Copyright [yyyy] [name of copyright owner]
|
||||||
|
|
||||||
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
you may not use this file except in compliance with the License.
|
||||||
|
You may obtain a copy of the License at
|
||||||
|
|
||||||
|
http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
|
||||||
|
Unless required by applicable law or agreed to in writing, software
|
||||||
|
distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
See the License for the specific language governing permissions and
|
||||||
|
limitations under the License.
|
19
bin/libraries/Licenses/MIT_License.txt
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
Copyright (c) 2013, 2014 EclipseSource
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
in the Software without restriction, including without limitation the rights
|
||||||
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
copies of the Software, and to permit persons to whom the Software is
|
||||||
|
furnished to do so, subject to the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included in all
|
||||||
|
copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||||
|
SOFTWARE.
|
BIN
bin/libraries/commons-io-2.5.jar
Normal file
BIN
bin/libraries/jfoenix-1.3.0.jar
Normal file
BIN
bin/libraries/minimal-json-0.9.4.jar
Normal file
BIN
bin/libraries/sqlite-jdbc-3.16.1.jar
Normal file
50
bin/recources/HomeFlix-Local_de_DE.properties
Normal file
@ -0,0 +1,50 @@
|
|||||||
|
# HomeFlix-Local_de_DE.properties German Local
|
||||||
|
info = Info
|
||||||
|
settings = Einstellungen
|
||||||
|
streamingSettings = Stream Einst.
|
||||||
|
tfPath = Pfad...
|
||||||
|
tfSearch = Suche...
|
||||||
|
openFolder = Ordner \u00F6ffnen
|
||||||
|
chooseFolder = Ordner ausw\u00E4hlen
|
||||||
|
fontSize = Schriftgr\u00F6\u00DFe:
|
||||||
|
checkUpdates = Auf Update pr\u00FCfen
|
||||||
|
checkingUpdates = Es wird nach Updates gesucht...
|
||||||
|
updateBtnavail = Update verf\u00FCgbar
|
||||||
|
updateBtnNotavail = Kein Update verf\u00FCgbar
|
||||||
|
autoUpdate = beim Start nach Updates suchen:
|
||||||
|
version = Version:
|
||||||
|
columnName = Name
|
||||||
|
columnRating = Bewertung
|
||||||
|
columnStreamUrl = Datei Name
|
||||||
|
columnResolution = Aufl\u00F6sung
|
||||||
|
columnSeason = Staffel
|
||||||
|
columnYear = Jahr
|
||||||
|
errorUpdateV = Beim ausf\u00FChren des Updates ist ein Fehler aufgetreten! \nError: could not check update version (nvc)\nWeitere Hilfe erhalten sie unter www.kellerkinder.xyz \noder wenden sie sich an support@kellerkinder.xyz
|
||||||
|
errorUpdateD = Beim ausf\u00FChren des Updates ist ein Fehler aufgetreten! \nError: could not download update files (ndf)\nWeitere Hilfe erhalten sie unter www.kellerkinder.xyz \noder wenden sie sich an support@kellerkinder.xyz
|
||||||
|
errorPlay = Beim \u00F6ffnen der Datei ist ein Fehler aufgetreten! \nError: could not open file (nof) \nWeitere Hilfe erhalten sie unter www.kellerkinder.xyz \noder wenden sie sich an support@kellerkinder.xyz
|
||||||
|
errorMode = Oh, da lief etwas falsch! Da hat jemand einen falschen Modus verwendet. \nError: mode unknow (muk)\nWeitere Hilfe erhalten sie unter www.kellerkinder.xyz \noder wenden sie sich an support@kellerkinder.xyz
|
||||||
|
errorOpenStream = Beim \u00F6ffnen des Streams ist ein Fehler aufgetreten!
|
||||||
|
errorLoad = Beim laden der Einstellungen ist ein Fehler aufgetreten!
|
||||||
|
errorSave = Beim speichern der Einstellungen ist ein Fehler aufgetreten!
|
||||||
|
noFilmFound = Kein Film mit diesem Titel gefunden!
|
||||||
|
linuxBug = Zurzeit werden unter Linux leider keine Dateien mit Leerzeichen unterst\u00FCtzt!
|
||||||
|
vlcNotInstalled = Um einen Film abspielen wird der VLC Media Player ben\u00F6tigt!
|
||||||
|
infoText = \nMaintainer: seilo@kellerkinder.xyz und \nhendrik.schutter@coptersicht.de \n(c) 2016-2017 Kellerkinder www.kellerkinder.xyz
|
||||||
|
title = Titel
|
||||||
|
year = Jahr
|
||||||
|
rating = Einstufung
|
||||||
|
publishedOn = Ver\u00F6ffentlicht am
|
||||||
|
duration = Laufzeit
|
||||||
|
genre = Gener
|
||||||
|
director = Regisseur
|
||||||
|
writer = Autor
|
||||||
|
actors = Schauspieler
|
||||||
|
plot = Beschreibung
|
||||||
|
language = Original Sprache
|
||||||
|
country = Produktionsland
|
||||||
|
awards = Auszeichnungen
|
||||||
|
metascore = Metascore
|
||||||
|
imdbRating = IMDB-Bewertung
|
||||||
|
type = Type
|
||||||
|
firstStartHeader = Es ist kein Stammverzeichnis f\u00FCr Filme angegeben!
|
||||||
|
firstStartContent = Stammverzeichniss angeben?
|
50
bin/recources/HomeFlix-Local_en_US.properties
Normal file
@ -0,0 +1,50 @@
|
|||||||
|
# HomeFlix-Local_en_US.properties US-English Local and default
|
||||||
|
info = Info
|
||||||
|
settings = Settings
|
||||||
|
streamingSettings = Stream Settings
|
||||||
|
tfPath = Path...
|
||||||
|
tfSearch = Search...
|
||||||
|
openFolder = open Folder
|
||||||
|
chooseFolder = choose Directory
|
||||||
|
fontSize = font size:
|
||||||
|
checkUpdates = check for updates
|
||||||
|
checkingUpdates = checking for updates...
|
||||||
|
updateBtnavail = update available
|
||||||
|
updateBtnNotavail = no update available
|
||||||
|
autoUpdate = check at startup for updates:
|
||||||
|
version = Version:
|
||||||
|
columnName = Name
|
||||||
|
columnRating = Rating
|
||||||
|
columnStreamUrl = File Name
|
||||||
|
columnResolution = Resolution
|
||||||
|
columnSeason = Season
|
||||||
|
columnYear = Year
|
||||||
|
errorUpdateV = An error has occurred during update! \nError: could not check update version (nvc) \nTo get help, visit www.kellerkinder.xyz \nor contcat support@kellerkinder.xyz
|
||||||
|
errorUpdateD = An error has occurred during update! \nError: could not download update files (ndf) \nTo get help, visit www.kellerkinder.xyz \nor contcat support@kellerkinder.xyz
|
||||||
|
errorPlay = An error has occurred during opening the file! \nError: could not open file (nof) \nTo get help, visit www.kellerkinder.xyz \nor contcat support@kellerkinder.xyz
|
||||||
|
errorMode = Oh, something went wrong! It seems someone has used a wrong mode. \nError: mode unknow (muk) \nTo get help, visit www.kellerkinder.xyz \nor contcat support@kellerkinder.xyz
|
||||||
|
errorOpenStream = An error has occurred during opening the stream!
|
||||||
|
errorLoad = An error occurred while loading the settings!
|
||||||
|
errorSave = An error occurred while saving the settings!
|
||||||
|
noFilmFound = No film with this title found!
|
||||||
|
linuxBug = Currently no files are supported with additional space under Linux unfortunately!
|
||||||
|
vlcNotInstalled = VLC Media Player is required to play a movie!
|
||||||
|
infoText = \nMaintainer: seilo@kellerkinder.xyz and \nhendrik.schutter@coptersicht.de \n(c) 2016-2017 Kellerkinder www.kellerkinder.xyz
|
||||||
|
title = Title
|
||||||
|
year = Year
|
||||||
|
rating = Rating
|
||||||
|
publishedOn = published on
|
||||||
|
duration = Duration
|
||||||
|
genre = Gener
|
||||||
|
director = Director
|
||||||
|
writer = Writer
|
||||||
|
actors = Actors
|
||||||
|
plot = Plot
|
||||||
|
language = Language
|
||||||
|
country = Country
|
||||||
|
awards = Awards
|
||||||
|
metascore = Metascore
|
||||||
|
imdbRating = IMDB-Rating
|
||||||
|
type = Type
|
||||||
|
firstStartHeader = There is no root directory for movies!
|
||||||
|
firstStartContent = Specify a root directory?
|
Before Width: | Height: | Size: 24 KiB After Width: | Height: | Size: 24 KiB |
Before Width: | Height: | Size: 30 KiB After Width: | Height: | Size: 30 KiB |
BIN
bin/recources/icons/close_black_2048x2048.png
Normal file
After Width: | Height: | Size: 9.3 KiB |
BIN
bin/recources/icons/ic_favorite_black_18dp_1x.png
Normal file
After Width: | Height: | Size: 214 B |
BIN
bin/recources/icons/ic_favorite_border_black_18dp_1x.png
Normal file
After Width: | Height: | Size: 261 B |
BIN
bin/recources/icons/ic_play_arrow_black_18dp_1x.png
Normal file
After Width: | Height: | Size: 131 B |
BIN
bin/recources/icons/ic_play_arrow_white_18dp_1x.png
Normal file
After Width: | Height: | Size: 135 B |
BIN
bin/recources/icons/ic_search_black_18dp_1x.png
Normal file
After Width: | Height: | Size: 215 B |
BIN
bin/recources/icons/ic_skip_next_black_18dp_1x.png
Normal file
After Width: | Height: | Size: 128 B |
BIN
bin/recources/icons/ic_skip_next_white_18dp_1x.png
Normal file
After Width: | Height: | Size: 134 B |
BIN
bin/recources/icons/ic_skip_previous_black_18dp_1x.png
Normal file
After Width: | Height: | Size: 131 B |
BIN
bin/recources/icons/ic_skip_previous_white_18dp_1x.png
Normal file
After Width: | Height: | Size: 138 B |
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 14 KiB |
Before Width: | Height: | Size: 15 KiB After Width: | Height: | Size: 15 KiB |
10
config.xml
@ -1,10 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
|
||||||
<!DOCTYPE properties SYSTEM "http://java.sun.com/dtd/properties.dtd">
|
|
||||||
<properties>
|
|
||||||
<comment>Project HomeFlix settings</comment>
|
|
||||||
<entry key="autoUpdate">0</entry>
|
|
||||||
<entry key="color">ee3523</entry>
|
|
||||||
<entry key="local">1</entry>
|
|
||||||
<entry key="size">12.0</entry>
|
|
||||||
<entry key="path">C:\Users\Jannik\Videos\Beispielfilme</entry>
|
|
||||||
</properties>
|
|
@ -1,204 +1,616 @@
|
|||||||
|
/**
|
||||||
|
* @author Jannik
|
||||||
|
* DBController for Project HomeFlix
|
||||||
|
* connection is in manual commit!
|
||||||
|
*/
|
||||||
|
|
||||||
package application;
|
package application;
|
||||||
|
|
||||||
import java.sql.Connection; //f<>r Datenbank
|
import java.io.File;
|
||||||
import java.sql.DriverManager; //f<>r Datenbank
|
import java.io.FileNotFoundException;
|
||||||
import java.sql.PreparedStatement; //f<>r Datenbank
|
import java.io.FileReader;
|
||||||
import java.sql.ResultSet; //f<>r Datenbank
|
import java.io.IOException;
|
||||||
import java.sql.SQLException; //f<>r Datenbank
|
import java.sql.Connection;
|
||||||
import java.sql.Statement; //f<>r Datenbank
|
import java.sql.DriverManager;
|
||||||
import java.io.File;//f<>r Dateien einlesen
|
import java.sql.PreparedStatement;
|
||||||
|
import java.sql.ResultSet;
|
||||||
|
import java.sql.SQLException;
|
||||||
|
import java.sql.Statement;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
class DBController {
|
import com.eclipsesource.json.Json;
|
||||||
|
import com.eclipsesource.json.JsonArray;
|
||||||
|
import com.eclipsesource.json.JsonObject;
|
||||||
|
import com.eclipsesource.json.JsonValue;
|
||||||
|
import javafx.scene.image.Image;
|
||||||
|
import javafx.scene.image.ImageView;
|
||||||
|
import javafx.scene.text.Font;
|
||||||
|
import javafx.scene.text.FontWeight;
|
||||||
|
import javafx.scene.text.Text;
|
||||||
|
|
||||||
|
public class DBController {
|
||||||
|
|
||||||
|
public DBController(MainWindowController m, Main main) {
|
||||||
|
mainWindowController = m;
|
||||||
|
this.main = main;
|
||||||
|
}
|
||||||
|
|
||||||
@SuppressWarnings("unused")
|
|
||||||
private MainWindowController mainWindowController;
|
private MainWindowController mainWindowController;
|
||||||
private static final DBController dbcontroller = new DBController();
|
private Main main;
|
||||||
private static Connection connection;
|
private String DB_PATH = System.getProperty("user.home") + "\\Documents\\HomeFlix" + "\\" + "Homeflix.db"; //path to database file
|
||||||
private static final String DB_PATH = System.getProperty("user.dir") + "/" + "Homeflix.db"; // der Pfad der Datenbank-Datei
|
private Image favorite_black = new Image("recources/icons/ic_favorite_black_18dp_1x.png");
|
||||||
private String path;
|
private Image favorite_border_black = new Image("recources/icons/ic_favorite_border_black_18dp_1x.png");
|
||||||
File f;
|
private List<String> filmsdbAll = new ArrayList<String>();
|
||||||
File file[]; //ArrayList f<>r die Dateien
|
private List<String> filmsdbLocal = new ArrayList<String>();
|
||||||
|
private List<String> filmsdbStream = new ArrayList<String>();
|
||||||
|
private List<String> filmsdbStreamURL = new ArrayList<String>();
|
||||||
|
private List<String> filmsAll = new ArrayList<String>();
|
||||||
|
private List<String> filmsDir = new ArrayList<String>();
|
||||||
|
private List<String> filmsStream = new ArrayList<String>();
|
||||||
|
private List<String> filmsStreamURL = new ArrayList<String>();
|
||||||
|
private List<String> filmsStreamData = new ArrayList<String>();
|
||||||
|
Connection connection = null;
|
||||||
|
|
||||||
static {
|
public void main() {
|
||||||
|
if (System.getProperty("os.name").equals("Linux")) {
|
||||||
|
DB_PATH = System.getProperty("user.home") + "/HomeFlix/Homeflix.db";
|
||||||
|
}else{
|
||||||
|
DB_PATH = System.getProperty("user.home") + "\\Documents\\HomeFlix" + "\\" + "Homeflix.db";
|
||||||
|
}
|
||||||
try {
|
try {
|
||||||
Class.forName("org.sqlite.JDBC"); //Datenbanktreiber
|
// create a database connection
|
||||||
} catch (ClassNotFoundException e) {
|
|
||||||
System.err.println("Fehler beim Laden des JDBC-Treibers");
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void main(String input) {
|
|
||||||
DBController datenbank = DBController.getInstance(); //neues Datenbank-Objekt wird erstellt
|
|
||||||
datenbank.setPath(input); // Pfad zuweisen
|
|
||||||
datenbank.f = new File(datenbank.getPath()); // f<>r Datenbank-Datei einlesen
|
|
||||||
datenbank.file = datenbank.f.listFiles(); // f<>r Datenbank-Datei einlesen
|
|
||||||
datenbank.verbindeDatenbank();
|
|
||||||
datenbank.fuelleDatenbank();
|
|
||||||
//datenbank.defavorisieren("Frozen");
|
|
||||||
//datenbank.favorisieren("Frozen");
|
|
||||||
//datenbank.ausgebenTitel();
|
|
||||||
//System.out.println("Pfad: " + datenbank.getPfad("Frozen"));
|
|
||||||
//System.out.println("Bewertung: " + datenbank.getFavStatus("Frozen"));
|
|
||||||
}
|
|
||||||
|
|
||||||
DBController(){
|
|
||||||
}
|
|
||||||
|
|
||||||
private static DBController getInstance(){
|
|
||||||
return dbcontroller;
|
|
||||||
}
|
|
||||||
// Die Datenbak wird mit Hilfe des JDBC-Treibers eingebunden
|
|
||||||
public void verbindeDatenbank() {
|
|
||||||
try {
|
|
||||||
if (connection != null)
|
|
||||||
return;
|
|
||||||
System.out.println("Erstelle Verbindung zur Datenbank...");
|
|
||||||
connection = DriverManager.getConnection("jdbc:sqlite:" + DB_PATH);
|
connection = DriverManager.getConnection("jdbc:sqlite:" + DB_PATH);
|
||||||
if (!connection.isClosed())
|
connection.setAutoCommit(false); //AutoCommit to false -> manual commit is active
|
||||||
System.out.println("...Verbindung hergestellt");
|
|
||||||
} catch (SQLException e) {
|
} catch (SQLException e) {
|
||||||
throw new RuntimeException(e);
|
// if the error message is "out of memory", it probably means no database file is found
|
||||||
|
System.err.println(e.getMessage());
|
||||||
}
|
}
|
||||||
|
|
||||||
Runtime.getRuntime().addShutdownHook(new Thread() {
|
//close connection -> at the moment this kills the program
|
||||||
public void run() {
|
// finally {
|
||||||
try {
|
// try {
|
||||||
if (!connection.isClosed() && connection != null) {
|
// if (connection != null)
|
||||||
connection.close();
|
// connection.close();
|
||||||
if (connection.isClosed())
|
// } catch (SQLException e) {
|
||||||
System.out.println("Verbindung getrennt");
|
// // connection close failed.
|
||||||
}
|
// System.err.println(e);
|
||||||
} catch (SQLException e) {
|
// }
|
||||||
e.printStackTrace();
|
// }
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
// Die Dateien werden in die Datenbank geschrieben
|
|
||||||
public void fuelleDatenbank() {
|
|
||||||
|
|
||||||
try {
|
|
||||||
System.out.println("Erstelle Eintr<74>ge");
|
|
||||||
Statement stmt = connection.createStatement();
|
|
||||||
stmt.executeUpdate("DROP TABLE IF EXISTS filme;");
|
|
||||||
stmt.executeUpdate("CREATE TABLE filme (titel, pfad, bewertung);"); // Tabelle "filme" und die Spalten "titel", "pfad", "bewertung" erstellen
|
|
||||||
|
|
||||||
PreparedStatement ps = connection.prepareStatement("INSERT INTO filme VALUES (?, ?, ?);"); // SQL Befehl
|
|
||||||
|
|
||||||
//System.out.println(file.length);
|
|
||||||
|
|
||||||
for(int i=0;i!=file.length;i++) // Geht alle Dateien im Verzeichniss durch
|
|
||||||
{
|
|
||||||
//System.out.println(file[i].getName());
|
|
||||||
ps.setString(1, ohneEndung(file[i].getName())); // definiert Name als String in der ersten Spalte
|
|
||||||
ps.setString(2,file[i].getName()); // definiert Pfad als String in der zweiten Spalte
|
|
||||||
ps.setInt(3, 0); // definiert Bewertung als Integer in der dritten Spalte
|
|
||||||
ps.addBatch(); // f<>gt den Eintrag hinzu
|
|
||||||
}
|
}
|
||||||
|
|
||||||
connection.setAutoCommit(false);
|
void createDatabase() {
|
||||||
ps.executeBatch(); // scheibt alle Eintr<74>ge in die Datenbank
|
System.out.println("<==========starting loading sql==========>");
|
||||||
connection.setAutoCommit(true);
|
|
||||||
//connection.close();
|
PreparedStatement ps;
|
||||||
} catch (SQLException e) {
|
PreparedStatement psS;
|
||||||
System.err.println("Konnte nicht ausgef<65>hrt werden");
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public void ausgeben(){
|
|
||||||
System.out.println("Eintr<EFBFBD>ge ausgeben");
|
|
||||||
try {
|
try {
|
||||||
Statement stmt = connection.createStatement();
|
Statement stmt = connection.createStatement();
|
||||||
mainWindowController = new MainWindowController();
|
stmt.executeUpdate("create table if not exists film_local (rating, titel, streamUrl, favIcon, cached)");
|
||||||
ResultSet rs = stmt.executeQuery("SELECT * FROM filme;");
|
stmt.executeUpdate("create table if not exists film_streaming (year, season, episode, rating, resolution, titel, streamUrl, favIcon, cached)");
|
||||||
|
stmt.close();
|
||||||
|
} catch (SQLException e1) {
|
||||||
|
e1.printStackTrace();
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
Statement stmt = connection.createStatement();
|
||||||
|
ResultSet rs = stmt.executeQuery("SELECT * FROM film_local");
|
||||||
while (rs.next()) {
|
while (rs.next()) {
|
||||||
// MainWindowController mainWindowController = new MainWindowController();
|
filmsdbLocal.add(rs.getString(2));
|
||||||
}
|
}
|
||||||
//rs.close();
|
stmt.close();
|
||||||
// mainWindowController.initTabel();
|
rs.close();
|
||||||
|
|
||||||
|
rs = stmt.executeQuery("SELECT * FROM film_streaming;");
|
||||||
} catch (SQLException e) {
|
while (rs.next()) {
|
||||||
System.err.println("Konnte nicht ausgef<65>hrt werden");
|
filmsdbStream.add(rs.getString(6));
|
||||||
e.printStackTrace();
|
filmsdbStreamURL.add(rs.getString(7));
|
||||||
|
}
|
||||||
|
stmt.close();
|
||||||
|
rs.close();
|
||||||
|
}catch (SQLException ea){
|
||||||
|
System.err.println("Ups! an error occured!");
|
||||||
|
ea.printStackTrace();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
String[] entries = new File(mainWindowController.getPath()).list();
|
||||||
|
if(mainWindowController.getPath().equals("") || mainWindowController.getPath() == null){
|
||||||
|
System.out.println("Kein Pfad angegeben"); //if path == null or ""
|
||||||
|
}else{
|
||||||
|
System.out.println(entries.length);
|
||||||
|
for(int i=0;i!=entries.length;i++){
|
||||||
|
filmsDir.add(cutOffEnd(entries[i]));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
for(int v=0; v< mainWindowController.streamingData.size(); v++){
|
||||||
|
String fileName = mainWindowController.getStreamingPath()+"/"+mainWindowController.streamingData.get(v).getStreamUrl();
|
||||||
|
try {
|
||||||
|
JsonObject object = Json.parse(new FileReader(fileName)).asObject();
|
||||||
|
JsonArray items = object.get("entries").asArray();
|
||||||
|
for (JsonValue item : items) {
|
||||||
|
filmsStream.add(item.asObject().getString("titel",""));
|
||||||
|
filmsStreamURL.add(item.asObject().getString("streamUrl",""));
|
||||||
|
filmsStreamData.add(fileName);
|
||||||
|
}
|
||||||
|
} catch (IOException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
filmsAll.addAll(filmsDir);
|
||||||
|
filmsAll.addAll(filmsStream);
|
||||||
|
filmsdbAll.addAll(filmsdbLocal);
|
||||||
|
filmsdbAll.addAll(filmsdbStream);
|
||||||
|
System.out.println("films in directory: "+filmsAll.size());
|
||||||
|
System.out.println("filme in db: "+filmsdbAll.size());
|
||||||
|
|
||||||
|
if(filmsdbAll.size() == 0){
|
||||||
|
System.out.println("creating entries ...");
|
||||||
|
|
||||||
|
try{
|
||||||
|
ps = connection.prepareStatement("insert into film_local values (?, ?, ?, ?, ?)");
|
||||||
|
psS = connection.prepareStatement("insert into film_streaming values (?, ?, ?, ?, ?, ?, ?, ?, ?)");
|
||||||
|
|
||||||
|
if(mainWindowController.getPath().equals("") || mainWindowController.getPath() == null){
|
||||||
|
System.out.println("Kein Pfad angegeben"); //if path == null or ""
|
||||||
|
}else{
|
||||||
|
for(int j=0;j!=entries.length;j++) //goes through all the files in the directory
|
||||||
|
{
|
||||||
|
ps.setInt(1, 0); //rating as integer 1. column
|
||||||
|
ps.setString(2, cutOffEnd(entries[j])); //name as String without ending 2. column
|
||||||
|
ps.setString(3,entries[j]); //path as String 3. column
|
||||||
|
ps.setString(4, "favorite_border_black");
|
||||||
|
ps.setBoolean(5, false);
|
||||||
|
ps.addBatch(); // add command to prepared statement
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if(mainWindowController.getStreamingPath().equals("")||mainWindowController.getStreamingPath().equals(null)){
|
||||||
|
System.out.println("Kein Pfad angegeben"); //if path == null or ""
|
||||||
|
}else{
|
||||||
|
for(int i=0; i< mainWindowController.streamingData.size(); i++){
|
||||||
|
String fileNamea = mainWindowController.getStreamingPath()+"/"+mainWindowController.streamingData.get(i).getStreamUrl();
|
||||||
|
try {
|
||||||
|
JsonObject object = Json.parse(new FileReader(fileNamea)).asObject();
|
||||||
|
JsonArray items = object.get("entries").asArray();
|
||||||
|
for (JsonValue item : items) {
|
||||||
|
psS.setInt(1, item.asObject().getInt("year", 0));
|
||||||
|
psS.setInt(2, item.asObject().getInt("season", 0));
|
||||||
|
psS.setInt(3, item.asObject().getInt("episode", 0));
|
||||||
|
psS.setInt(4, 0);
|
||||||
|
psS.setString(5, item.asObject().getString("resolution", ""));
|
||||||
|
psS.setString(6, item.asObject().getString("titel",""));
|
||||||
|
psS.setString(7, item.asObject().getString("streamUrl", ""));
|
||||||
|
psS.setString(8, "favorite_border_black");
|
||||||
|
psS.setBoolean(9, false);
|
||||||
|
psS.addBatch(); // add command to prepared statement
|
||||||
|
}
|
||||||
|
} catch (IOException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
ps.executeBatch(); //execute statement to write entries into table
|
||||||
|
psS.executeBatch();
|
||||||
|
connection.commit();
|
||||||
|
ps.close();
|
||||||
|
psS.close();
|
||||||
|
}catch (SQLException ea) {
|
||||||
|
System.err.println("Konnte nicht ausgef<65>hrt werden");
|
||||||
|
ea.printStackTrace();
|
||||||
|
}
|
||||||
|
}else {
|
||||||
|
|
||||||
|
|
||||||
|
try {
|
||||||
|
try {
|
||||||
|
checkAddEntry(); //check if added a new file
|
||||||
|
} catch (IOException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
checkRemoveEntry(); //check if removed a file
|
||||||
|
} catch (SQLException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//start of cache-table
|
||||||
|
try {
|
||||||
|
Statement stmt = connection.createStatement();
|
||||||
|
stmt.executeUpdate( "create table if not exists cache (streamUrl, Title, Year, Rated, Released, Runtime, Genre, Director, Writer," //streamUrl is primary key
|
||||||
|
+" Actors, Plot, Language, Country, Awards, Metascore, imdbRating, imdbVotes, imdbID, Type, Poster, Response)");
|
||||||
|
stmt.close();
|
||||||
|
} catch (SQLException e1) {
|
||||||
|
e1.printStackTrace();
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
// Kontroll Methode, ob ein Film wirklich in der Datenbank ist
|
|
||||||
public String getTitel(String name){
|
//loading data from database to mainWindowController
|
||||||
|
void loadData(){
|
||||||
|
System.out.println("loading data to mwc ...");
|
||||||
try {
|
try {
|
||||||
|
//load local Data
|
||||||
Statement stmt = connection.createStatement();
|
Statement stmt = connection.createStatement();
|
||||||
ResultSet rs = stmt.executeQuery("SELECT titel, pfad FROM filme WHERE titel = '"+name+"';" );
|
ResultSet rs = stmt.executeQuery("SELECT * FROM film_local ORDER BY titel");
|
||||||
return rs.getString("titel");
|
while (rs.next()) {
|
||||||
|
if(rs.getString(4).equals("favorite_black")){
|
||||||
|
mainWindowController.localFilms.add( new tableData(1, 1, 1, rs.getDouble(1), "1", rs.getString(2), rs.getString(3), new ImageView(favorite_black),rs.getBoolean(5)));
|
||||||
|
}else{
|
||||||
|
mainWindowController.localFilms.add( new tableData(1, 1, 1, rs.getDouble(1), "1", rs.getString(2), rs.getString(3), new ImageView(favorite_border_black),rs.getBoolean(5)));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
stmt.close();
|
||||||
|
rs.close();
|
||||||
|
|
||||||
|
//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")){
|
||||||
|
mainWindowController.streamingFilms.add(new tableData(rs.getInt(1), rs.getInt(2), rs.getInt(3), rs.getDouble(4), rs.getString(5), rs.getString(6), rs.getString(7), new ImageView(favorite_black),rs.getBoolean(9)));
|
||||||
|
}else{
|
||||||
|
mainWindowController.streamingFilms.add(new tableData(rs.getInt(1), rs.getInt(2), rs.getInt(3), rs.getDouble(4), rs.getString(5), rs.getString(6), rs.getString(7), new ImageView(favorite_border_black),rs.getBoolean(9)));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
stmt.close();
|
||||||
|
rs.close();
|
||||||
} catch (SQLException e) {
|
} catch (SQLException e) {
|
||||||
System.err.println("Konnte nicht ausgef<65>hrt werden");
|
System.err.println("Ups! an error occured!");
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
return "Error 404";
|
System.out.println("<==========finished loading sql==========>");
|
||||||
}
|
}
|
||||||
// gibt den Pfad eines bestimmten Films
|
|
||||||
public String getPfad(String name){
|
//Refreshes the data in mainWindowController.newDaten and mainWindowController.streamData
|
||||||
|
//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;
|
||||||
|
|
||||||
|
try {
|
||||||
|
stmt = connection.createStatement();
|
||||||
|
ResultSet rs = stmt.executeQuery("SELECT * FROM film_local WHERE titel = '"+name+"';" );
|
||||||
|
if(rs.getString(4).equals("favorite_black")){
|
||||||
|
mainWindowController.localFilms.set(i, new tableData(1, 1, 1, rs.getDouble(1), "1", rs.getString(2), rs.getString(3), new ImageView(favorite_black),rs.getBoolean(5)));
|
||||||
|
}else{
|
||||||
|
mainWindowController.localFilms.set(i, new tableData(1, 1, 1, rs.getDouble(1), "1", rs.getString(2), rs.getString(3), new ImageView(favorite_border_black),rs.getBoolean(5)));
|
||||||
|
}
|
||||||
|
stmt.close();
|
||||||
|
rs.close();
|
||||||
|
} catch (SQLException e) {
|
||||||
|
try {
|
||||||
|
stmt = connection.createStatement();
|
||||||
|
ResultSet rs = stmt.executeQuery("SELECT * FROM film_streaming WHERE titel = '"+name+"';" );
|
||||||
|
if(rs.getString(8).equals("favorite_black")){
|
||||||
|
mainWindowController.streamingFilms.set(i,new tableData(rs.getInt(1), rs.getInt(2), rs.getInt(3), rs.getDouble(4), rs.getString(5), rs.getString(6), rs.getString(7), new ImageView(favorite_black),rs.getBoolean(9)));
|
||||||
|
}else{
|
||||||
|
mainWindowController.streamingFilms.set(i,new tableData(rs.getInt(1), rs.getInt(2), rs.getInt(3), rs.getDouble(4), rs.getString(5), rs.getString(6), rs.getString(7), new ImageView(favorite_border_black),rs.getBoolean(9)));
|
||||||
|
}
|
||||||
|
stmt.close();
|
||||||
|
rs.close();
|
||||||
|
} catch (SQLException e1) {
|
||||||
|
System.err.println("Ups! an error occured!");
|
||||||
|
e1.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* check if there are any entries that have been removed from the film-directory
|
||||||
|
* @throws SQLException
|
||||||
|
*/
|
||||||
|
private void checkRemoveEntry() throws SQLException{
|
||||||
|
System.out.println("checking for entrys to remove to DB ...");
|
||||||
|
Statement stmt = connection.createStatement();
|
||||||
|
|
||||||
|
for(int a=0; a<filmsdbLocal.size(); a++){
|
||||||
|
if(filmsDir.contains(filmsdbLocal.get(a))){
|
||||||
|
}else{
|
||||||
|
stmt.executeUpdate("delete from film_local where titel = '"+filmsdbLocal.get(a)+"'");
|
||||||
|
connection.commit();
|
||||||
|
stmt.close();
|
||||||
|
System.out.println("removed \""+filmsdbLocal.get(a)+"\" from databsae");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
for(int b=0; b<filmsdbStreamURL.size(); b++){
|
||||||
|
if(filmsStreamURL.contains(filmsdbStreamURL.get(b))){
|
||||||
|
}else{
|
||||||
|
stmt.executeUpdate("delete from film_streaming where titel = '"+filmsdbStream.get(b)+"'");
|
||||||
|
connection.commit();
|
||||||
|
stmt.close();
|
||||||
|
System.out.println("removed \""+filmsdbStream.get(b)+"\" from databsae");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* check if there are new films in the film-directory
|
||||||
|
* @throws SQLException
|
||||||
|
* @throws FileNotFoundException
|
||||||
|
* @throws IOException
|
||||||
|
* if lastName != filmsStreamData.get(b) then set i = 0, file changed
|
||||||
|
*/
|
||||||
|
private void checkAddEntry() throws SQLException, FileNotFoundException, IOException{
|
||||||
|
String lastName = "";
|
||||||
|
System.out.println("checking for entrys to add to DB ...");
|
||||||
|
String[] entries = new File(mainWindowController.getPath()).list();
|
||||||
|
Statement stmt = connection.createStatement();
|
||||||
|
PreparedStatement ps = connection.prepareStatement("insert into film_streaming values (?, ?, ?, ?, ?, ?, ?, ?, ?)");
|
||||||
|
int i=0;
|
||||||
|
|
||||||
|
for(int a=0; a<filmsDir.size(); a++){
|
||||||
|
if(filmsdbLocal.contains(filmsDir.get(a))){
|
||||||
|
}else{
|
||||||
|
stmt.executeUpdate("insert into film_local values (0, '"+cutOffEnd(entries[a])+"', '"+entries[a]+"','favorite_border_black',0)");
|
||||||
|
connection.commit();
|
||||||
|
stmt.close();
|
||||||
|
System.out.println("added \""+filmsDir.get(a)+"\" to databsae");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
for(int b=0; b<filmsStreamURL.size(); b++){
|
||||||
|
if(filmsdbStreamURL.contains(filmsStreamURL.get(b))) {
|
||||||
|
} else {
|
||||||
|
if(lastName != "" && lastName != filmsStreamData.get(b)) {
|
||||||
|
i = 0;
|
||||||
|
}
|
||||||
|
lastName = filmsStreamData.get(b);
|
||||||
|
JsonObject object = Json.parse(new FileReader(filmsStreamData.get(b))).asObject();
|
||||||
|
JsonArray items = object.get("entries").asArray();
|
||||||
|
System.out.println(items.size()+", "+i+"; "+b);
|
||||||
|
String streamURL = items.get(i).asObject().getString("streamUrl","");
|
||||||
|
String titel = items.get(i).asObject().getString("titel","");
|
||||||
|
|
||||||
|
if(streamURL.equals(filmsStreamURL.get(b))){
|
||||||
|
System.out.println("hinzuf<EFBFBD>gen \""+titel+"\"");
|
||||||
|
|
||||||
|
ps.setInt(1, items.get(i).asObject().getInt("year", 0));
|
||||||
|
ps.setInt(2, items.get(i).asObject().getInt("season", 0));
|
||||||
|
ps.setInt(3, items.get(i).asObject().getInt("episode", 0));
|
||||||
|
ps.setInt(4, 0);
|
||||||
|
ps.setString(5, items.get(i).asObject().getString("resolution", ""));
|
||||||
|
ps.setString(6, items.get(i).asObject().getString("titel",""));
|
||||||
|
ps.setString(7, items.get(i).asObject().getString("streamUrl", ""));
|
||||||
|
ps.setString(8, "favorite_border_black");
|
||||||
|
ps.setBoolean(9, false);
|
||||||
|
ps.addBatch(); // adds the entry
|
||||||
|
}
|
||||||
|
i++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
ps.executeBatch();
|
||||||
|
connection.commit();
|
||||||
|
ps.close();
|
||||||
|
}
|
||||||
|
|
||||||
|
void ausgeben(){
|
||||||
|
System.out.println("Outputting all entries ... \n");
|
||||||
try {
|
try {
|
||||||
Statement stmt = connection.createStatement();
|
Statement stmt = connection.createStatement();
|
||||||
ResultSet rs = stmt.executeQuery("SELECT titel, pfad FROM filme WHERE titel = '"+name+"';" ); //SQL Befehl
|
ResultSet rs = stmt.executeQuery("SELECT * FROM film_local");
|
||||||
return rs.getString("pfad");
|
while (rs.next()) {
|
||||||
|
System.out.println(rs.getString(1));
|
||||||
|
System.out.println(rs.getString(2));
|
||||||
|
System.out.println(rs.getString(3));
|
||||||
|
System.out.println(rs.getString(4));
|
||||||
|
System.out.println(rs.getString(5)+"\n");
|
||||||
|
}
|
||||||
|
stmt.close();
|
||||||
|
rs.close();
|
||||||
|
|
||||||
|
System.out.println("Streaming Entries: \n");
|
||||||
|
|
||||||
|
rs = stmt.executeQuery("SELECT * FROM film_streaming;");
|
||||||
|
while (rs.next()) {
|
||||||
|
System.out.println(rs.getString(1));
|
||||||
|
System.out.println(rs.getString(2));
|
||||||
|
System.out.println(rs.getString(3));
|
||||||
|
System.out.println(rs.getString(4));
|
||||||
|
System.out.println(rs.getString(5));
|
||||||
|
System.out.println(rs.getString(6));
|
||||||
|
System.out.println(rs.getString(7));
|
||||||
|
System.out.println(rs.getString(8));
|
||||||
|
System.out.println(rs.getString(9)+"\n");
|
||||||
|
}
|
||||||
|
stmt.close();
|
||||||
|
rs.close();
|
||||||
|
|
||||||
} catch (SQLException e) {
|
} catch (SQLException e) {
|
||||||
System.err.println("Konnte nicht ausgef<65>hrt werden");
|
System.err.println("Ups! an error occured!");
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
return "Error 404";
|
}
|
||||||
}
|
|
||||||
// gibt die Favorisierung eines bestimmten Films
|
//get favorite status
|
||||||
public boolean getFavStatus(String name){
|
void getFavStatus(String name){
|
||||||
try {
|
try{
|
||||||
Statement stmt = connection.createStatement();
|
Statement stmt = connection.createStatement();
|
||||||
ResultSet rs = stmt.executeQuery("SELECT titel, bewertung FROM filme WHERE titel = '"+name+"';" ); //SQL Befehl
|
ResultSet rs = stmt.executeQuery("SELECT titel, rating, favIcon FROM film_local WHERE titel = '"+name+"';" ); //SQL Befehl
|
||||||
System.out.println(rs.getInt("bewertung"));
|
System.out.println("local:"+rs.getString("rating")+", "+rs.getString("titel")+", "+rs.getString("favIcon"));
|
||||||
if((rs.getInt("bewertung")) == 1){
|
stmt.close();
|
||||||
return true;
|
rs.close();
|
||||||
|
}catch(SQLException e){
|
||||||
|
try {
|
||||||
|
Statement stmtS = connection.createStatement();
|
||||||
|
ResultSet rsS = stmtS.executeQuery("SELECT titel, rating, favIcon FROM film_streaming WHERE titel = '"+name+"';" );
|
||||||
|
System.out.println("streaming:"+rsS.getString("rating")+", "+rsS.getString("titel")+", "+rsS.getString("favIcon"));
|
||||||
|
stmtS.close();
|
||||||
|
rsS.close();
|
||||||
|
} catch (SQLException e1) {
|
||||||
|
System.out.println("Ups! an error occured!");
|
||||||
|
e1.printStackTrace();
|
||||||
}
|
}
|
||||||
else{
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
} catch (SQLException e) {
|
|
||||||
System.err.println("Konnte nicht ausgef<65>hrt werden");
|
}
|
||||||
|
//set rating=0 and favorite_border_black
|
||||||
|
void dislike(String name,String streamUrl){
|
||||||
|
System.out.println("defavorisieren ...");
|
||||||
|
try{
|
||||||
|
Statement stmt = connection.createStatement();
|
||||||
|
stmt.executeUpdate("UPDATE film_local SET rating=0,favIcon='favorite_border_black' WHERE titel='"+name+"';");
|
||||||
|
connection.commit();
|
||||||
|
stmt.close();
|
||||||
|
}catch(SQLException e){
|
||||||
|
System.out.println("Ups! an error occured!");
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
// setzt die Defavorisierung eines bestimmten Films
|
|
||||||
public void defavorisieren(String name){
|
|
||||||
System.out.println("setze Bewertung");
|
|
||||||
try {
|
try {
|
||||||
Statement stmt = connection.createStatement();
|
Statement stmt = connection.createStatement();
|
||||||
String sql = ("UPDATE filme SET bewertung=0 WHERE titel='"+name+"';"); //SQL Befehl
|
stmt.executeUpdate("UPDATE film_streaming SET rating=0,favIcon='favorite_border_black' WHERE streamUrl='"+streamUrl+"';");
|
||||||
stmt.executeUpdate(sql);
|
connection.commit();
|
||||||
connection.setAutoCommit(false);
|
stmt.close();
|
||||||
connection.setAutoCommit(true);
|
} catch (SQLException e1) {
|
||||||
} catch (SQLException e) {
|
System.out.println("Ups! an error occured!");
|
||||||
System.err.println("Konnte nicht ausgef<65>hrt werden");
|
e1.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//set rating=1 and favorite_black
|
||||||
|
void like(String name,String streamUrl){
|
||||||
|
System.out.println("favorisieren ...");
|
||||||
|
try{
|
||||||
|
Statement stmt = connection.createStatement();
|
||||||
|
stmt.executeUpdate("UPDATE film_local SET rating=1,favIcon='favorite_black' WHERE titel='"+name+"';");
|
||||||
|
connection.commit();
|
||||||
|
stmt.close();
|
||||||
|
}catch(SQLException e){
|
||||||
|
System.out.println("Ups! an error occured!");
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
try {
|
||||||
|
Statement stmt = connection.createStatement();
|
||||||
|
stmt.executeUpdate("UPDATE film_streaming SET rating=1,favIcon='favorite_black' WHERE streamUrl='"+streamUrl+"';");
|
||||||
|
connection.commit();
|
||||||
|
stmt.close();
|
||||||
|
} catch (SQLException e1) {
|
||||||
|
System.out.println("Ups! an error occured!");
|
||||||
|
e1.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void setCached(String streamUrl) throws SQLException{
|
||||||
|
try{
|
||||||
|
Statement stmt = connection.createStatement();
|
||||||
|
stmt.executeUpdate("UPDATE film_local SET cached=1 WHERE streamUrl='"+streamUrl+"';");
|
||||||
|
connection.commit();
|
||||||
|
stmt.close();
|
||||||
|
}catch(SQLException e){
|
||||||
|
System.out.println("Ups! an error occured!");
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
try {
|
||||||
|
Statement stmt = connection.createStatement();
|
||||||
|
stmt.executeUpdate("UPDATE film_streaming SET cached=1 WHERE streamUrl='"+streamUrl+"';");
|
||||||
|
connection.commit();
|
||||||
|
stmt.close();
|
||||||
|
} catch (SQLException e1) {
|
||||||
|
System.out.println("Ups! an error occured!");
|
||||||
|
e1.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void addCache( String streamUrl, String Title, String Year, String Rated, String Released, String Runtime, String Genre, String Director,
|
||||||
|
String Writer, String Actors, String Plot, String Language, String Country, String Awards, String Metascore, String imdbRating,
|
||||||
|
String Type, String imdbVotes, String imdbID, String Poster, String Response) throws SQLException{
|
||||||
|
PreparedStatement ps = connection.prepareStatement("insert into cache values (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)");
|
||||||
|
|
||||||
|
System.out.println("adding to cache: " + Title);
|
||||||
|
ps.setString(1,streamUrl);
|
||||||
|
ps.setString(2,Title);
|
||||||
|
ps.setString(3,Year);
|
||||||
|
ps.setString(4,Rated);
|
||||||
|
ps.setString(5,Released);
|
||||||
|
ps.setString(6,Runtime);
|
||||||
|
ps.setString(7,Genre);
|
||||||
|
ps.setString(8,Director);
|
||||||
|
ps.setString(9,Writer);
|
||||||
|
ps.setString(10,Actors);
|
||||||
|
ps.setString(11,Plot);
|
||||||
|
ps.setString(12,Language);
|
||||||
|
ps.setString(13,Country);
|
||||||
|
ps.setString(14,Awards);
|
||||||
|
ps.setString(15,Metascore);
|
||||||
|
ps.setString(16,imdbRating);
|
||||||
|
ps.setString(17,imdbVotes);
|
||||||
|
ps.setString(18,imdbID);
|
||||||
|
ps.setString(19,Type);
|
||||||
|
ps.setString(20,Poster);
|
||||||
|
ps.setString(21,Response);
|
||||||
|
ps.addBatch();
|
||||||
|
ps.executeBatch();
|
||||||
|
connection.commit();
|
||||||
|
ps.close();
|
||||||
|
System.out.println("done!");
|
||||||
|
}
|
||||||
|
|
||||||
|
void readCache(String streamUrl){
|
||||||
|
try{
|
||||||
|
Statement stmt = connection.createStatement();
|
||||||
|
ResultSet rs = stmt.executeQuery("SELECT * FROM cache WHERE streamUrl='"+streamUrl+"';");
|
||||||
|
ArrayList<Text> nameText = new ArrayList<Text>();
|
||||||
|
ArrayList<Text> responseText = new ArrayList<Text>();
|
||||||
|
String fontFamily = main.getFONT_FAMILY();
|
||||||
|
Image im;
|
||||||
|
int fontSize = (int) Math.round(mainWindowController.size);
|
||||||
|
int j=2;
|
||||||
|
|
||||||
|
nameText.add(0, new Text(mainWindowController.title+": "));
|
||||||
|
nameText.add(1, new Text(mainWindowController.year+": "));
|
||||||
|
nameText.add(2, new Text(mainWindowController.rating+": "));
|
||||||
|
nameText.add(3, new Text(mainWindowController.publishedOn+": "));
|
||||||
|
nameText.add(4, new Text(mainWindowController.duration+": "));
|
||||||
|
nameText.add(5, new Text(mainWindowController.genre+": "));
|
||||||
|
nameText.add(6, new Text(mainWindowController.director+": "));
|
||||||
|
nameText.add(7, new Text(mainWindowController.writer+": "));
|
||||||
|
nameText.add(8, new Text(mainWindowController.actors+": "));
|
||||||
|
nameText.add(9, new Text(mainWindowController.plot+": "));
|
||||||
|
nameText.add(10, new Text(mainWindowController.language+": "));
|
||||||
|
nameText.add(11, new Text(mainWindowController.country+": "));
|
||||||
|
nameText.add(12, new Text(mainWindowController.awards+": "));
|
||||||
|
nameText.add(13, new Text(mainWindowController.metascore+": "));
|
||||||
|
nameText.add(14, new Text(mainWindowController.imdbRating+": "));
|
||||||
|
nameText.add(15, new Text(mainWindowController.type+": "));
|
||||||
|
|
||||||
|
for(int i=0; i<15; i++){
|
||||||
|
responseText.add(new Text(rs.getString(j)+"\n"));
|
||||||
|
j++;
|
||||||
|
}
|
||||||
|
responseText.add(new Text(rs.getString(19)+"\n"));
|
||||||
|
im = new Image(new File(rs.getString(20)).toURI().toString());
|
||||||
|
|
||||||
|
stmt.close();
|
||||||
|
rs.close();
|
||||||
|
|
||||||
|
for(int i=0; i<nameText.size(); i++){
|
||||||
|
nameText.get(i).setFont(Font.font (fontFamily, FontWeight.BOLD, fontSize));
|
||||||
|
responseText.get(i).setFont(Font.font(fontFamily, fontSize));
|
||||||
|
}
|
||||||
|
|
||||||
|
mainWindowController.textFlow.getChildren().remove(0, mainWindowController.textFlow.getChildren().size());
|
||||||
|
|
||||||
|
for(int i=0;i<nameText.size(); i++){
|
||||||
|
mainWindowController.textFlow.getChildren().addAll(nameText.get(i),responseText.get(i));
|
||||||
|
}
|
||||||
|
|
||||||
|
try{
|
||||||
|
mainWindowController.image1.setImage(im);
|
||||||
|
}catch (Exception e){
|
||||||
|
mainWindowController.image1.setImage(new Image("recources/icons/close_black_2048x2048.png"));
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
mainWindowController.image1.setImage(im);
|
||||||
|
|
||||||
|
}catch (SQLException e) {
|
||||||
|
System.out.println("Ups! an error occured!");
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// setzt die Favorisierung eines bestimmten Films
|
|
||||||
public void favorisieren(String name){
|
//removes the ending
|
||||||
System.out.println("setze Bewertung");
|
private String cutOffEnd (String str) {
|
||||||
try {
|
|
||||||
Statement stmt = connection.createStatement();
|
|
||||||
String sql = ("UPDATE filme SET bewertung=1 WHERE titel='"+name+"';"); //SQL Befehl
|
|
||||||
stmt.executeUpdate(sql);
|
|
||||||
connection.setAutoCommit(false);
|
|
||||||
connection.setAutoCommit(true);
|
|
||||||
} catch (SQLException e) {
|
|
||||||
System.err.println("Konnte nicht ausgef<65>hrt werden");
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
//entfernt die Endung
|
|
||||||
private static String ohneEndung (String str) {
|
|
||||||
|
|
||||||
if (str == null) return null;
|
if (str == null) return null;
|
||||||
int pos = str.lastIndexOf(".");
|
int pos = str.lastIndexOf(".");
|
||||||
@ -206,11 +618,5 @@ class DBController {
|
|||||||
return str.substring(0, pos);
|
return str.substring(0, pos);
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getPath() {
|
|
||||||
return path;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setPath(String path) {
|
|
||||||
this.path = path.replace("\\", "\\\\");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,16 +0,0 @@
|
|||||||
# HomeFlix-Local_de_DE.properties German Local
|
|
||||||
info = Info
|
|
||||||
settings = Einstellungen
|
|
||||||
play = play
|
|
||||||
openFolder = Ordner \u00F6ffnen
|
|
||||||
chooseFolder = Ordner ausw\u00E4hlen
|
|
||||||
fontSize = Schriftgr\u00F6\u00DFe:
|
|
||||||
checkUpdates = Auf Update pr\u00FCfen
|
|
||||||
autoUpdate = beim Start nach Updates suchen:
|
|
||||||
version = Version:
|
|
||||||
columnName = Name
|
|
||||||
columnRating = Bewertung
|
|
||||||
columnDatName = Datei Name
|
|
||||||
errorUpdateV = Beim ausf\u00FChren des Updates ist ein Fehler aufgetreten! \nError: could not check update version (nvc)\nWeitere Hilfe erhalten sie unter www.kellerkinder.xyz \noder wenden sie sich an support@kellerkinder.xyz
|
|
||||||
errorUpdateD = Beim ausf\u00FChren des Updates ist ein Fehler aufgetreten! \nError: could not download update files (ndf)\nWeitere Hilfe erhalten sie unter www.kellerkinder.xyz \noder wenden sie sich an support@kellerkinder.xyz
|
|
||||||
infoText = \nMaintainer: seilo@kellerkinder.xyz und \nhendrik.schutter@coptersicht.de \n(c) 2016 Kellerkinder www.kellerkinder.xyz
|
|
@ -1,16 +0,0 @@
|
|||||||
# HomeFlix-Local_en_US.properties US-English Local and default
|
|
||||||
info = Info
|
|
||||||
settings = Settings
|
|
||||||
play = play
|
|
||||||
openFolder = open Folder
|
|
||||||
chooseFolder = choose Directory
|
|
||||||
fontSize = font size:
|
|
||||||
checkUpdates = check for updates
|
|
||||||
autoUpdate = check at startup for updates:
|
|
||||||
version = Version:
|
|
||||||
columnName = Name
|
|
||||||
columnRating = Rating
|
|
||||||
columnDatName = File Name
|
|
||||||
errorUpdateV = An error has occurred during update! \nError: could not check update version (nvc) \nTo get help, visit www.kellerkinder.xyz \nor contcat support@kellerkinder.xyz
|
|
||||||
errorUpdateD = An error has occurred during update! \nError: could not download update files (ndf) \nTo get help, visit www.kellerkinder.xyz \nor contcat support@kellerkinder.xyz
|
|
||||||
infoText = \nMaintainer: seilo@kellerkinder.xyz and \nhendrik.schutter@coptersicht.de \n(c) 2016 Kellerkinder www.kellerkinder.xyz
|
|
@ -1,7 +1,7 @@
|
|||||||
/**
|
/**
|
||||||
* Project HomeFlix
|
* Project HomeFlix
|
||||||
*
|
*
|
||||||
* Copyright 2016 <admin@kellerkinder>
|
* Copyright 2016-2017 <admin@kellerkinder>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -19,14 +19,14 @@
|
|||||||
* MA 02110-1301, USA.
|
* MA 02110-1301, USA.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package application;
|
package application;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.FileInputStream;
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.InputStream;
|
import java.util.Locale;
|
||||||
import java.util.Optional;
|
import java.util.Optional;
|
||||||
import java.util.Properties;
|
import java.util.ResourceBundle;
|
||||||
|
|
||||||
import javafx.application.Application;
|
import javafx.application.Application;
|
||||||
import javafx.fxml.FXMLLoader;
|
import javafx.fxml.FXMLLoader;
|
||||||
@ -36,29 +36,37 @@ import javafx.scene.control.Alert.AlertType;
|
|||||||
import javafx.scene.control.ButtonType;
|
import javafx.scene.control.ButtonType;
|
||||||
import javafx.scene.image.Image;
|
import javafx.scene.image.Image;
|
||||||
import javafx.scene.layout.AnchorPane;
|
import javafx.scene.layout.AnchorPane;
|
||||||
import javafx.scene.paint.Color;
|
|
||||||
import javafx.stage.DirectoryChooser;
|
import javafx.stage.DirectoryChooser;
|
||||||
import javafx.stage.Stage;
|
import javafx.stage.Stage;
|
||||||
|
|
||||||
public class Main extends Application {
|
public class Main extends Application {
|
||||||
|
|
||||||
public Stage primaryStage;
|
Stage primaryStage;
|
||||||
private String path;
|
private String path;
|
||||||
private String color = "ee3523";
|
String currentWorkingDirectory;
|
||||||
private String autoUpdate = "0";
|
private String COLOR = "ee3523";
|
||||||
private double size = 12;
|
private String FONT_FAMILY = "System";
|
||||||
private int local = 0;
|
private String mode = "local"; //local or streaming TODO
|
||||||
Properties props = new Properties();
|
private String local = System.getProperty("user.language")+"_"+System.getProperty("user.country");
|
||||||
|
private boolean AUTO_UPDATE = false;
|
||||||
|
private double FONT_SIZE = 17;
|
||||||
|
private ResourceBundle bundle;
|
||||||
private MainWindowController mainWindowController;
|
private MainWindowController mainWindowController;
|
||||||
|
private File directory;
|
||||||
|
private File settingsFile;
|
||||||
|
private File posterCache;
|
||||||
|
private String dirWin = System.getProperty("user.home") + "/Documents/HomeFlix"; //Windows: C:/Users/"User"/Documents/HomeFlix
|
||||||
|
private String dirLinux = System.getProperty("user.home") + "/HomeFlix"; //Linux: /home/"User"/HomeFlix
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void start(Stage primaryStage) {
|
public void start(Stage primaryStage) throws IOException {
|
||||||
|
currentWorkingDirectory = new java.io.File( "." ).getCanonicalPath();
|
||||||
this.primaryStage = primaryStage;
|
this.primaryStage = primaryStage;
|
||||||
mainWindow();
|
mainWindow();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void mainWindow(){
|
private void mainWindow(){
|
||||||
File file = new File("config.xml");
|
|
||||||
try {
|
try {
|
||||||
FXMLLoader loader = new FXMLLoader(Main.class.getResource("MainWindow.fxml"));
|
FXMLLoader loader = new FXMLLoader(Main.class.getResource("MainWindow.fxml"));
|
||||||
AnchorPane pane = loader.load();
|
AnchorPane pane = loader.load();
|
||||||
@ -66,48 +74,85 @@ public class Main extends Application {
|
|||||||
primaryStage.setMinWidth(900.00);
|
primaryStage.setMinWidth(900.00);
|
||||||
primaryStage.setResizable(false);
|
primaryStage.setResizable(false);
|
||||||
primaryStage.setTitle("Project HomeFlix");
|
primaryStage.setTitle("Project HomeFlix");
|
||||||
primaryStage.getIcons().add(new Image(Main.class.getResourceAsStream("/Homeflix_Icon_64x64.png"))); //f<EFBFBD>gt Anwendungsicon hinzu
|
primaryStage.getIcons().add(new Image(Main.class.getResourceAsStream("/recources/Homeflix_Icon_64x64.png"))); //adds application icon
|
||||||
|
|
||||||
|
mainWindowController = loader.getController(); //Link of FXMLController and controller class
|
||||||
|
mainWindowController.setAutoUpdate(AUTO_UPDATE); //set auto-update
|
||||||
|
mainWindowController.setCurrentWorkingDirectory(currentWorkingDirectory);
|
||||||
|
mainWindowController.setMain(this); //call setMain
|
||||||
|
|
||||||
mainWindowController = loader.getController(); //verkn<6B>pfung von FXMLController und Controller Klasse
|
/**Linux else Windows, check if directory & config exist
|
||||||
mainWindowController.setAutoUpdate(autoUpdate); //setzt autoupdate
|
* Windows: config file: C:/Users/"User"/Documents/HomeFlix/config.xml
|
||||||
mainWindowController.setMain(this); //aufruf setMain
|
* directory: C:/Users/"User"/Documents/HomeFlix
|
||||||
|
* Linux: config file: /home/"User"/HomeFlix/config.xml
|
||||||
//pr<70>ft ob config.xml vorhanden, wenn nicht hole Pfad und schreibe Daten in Controller
|
* directory: /home/"User"/HomeFlix
|
||||||
if (file.exists() != true) {
|
*/
|
||||||
mainWindowController.setPath(firstStart());
|
if(System.getProperty("os.name").equals("Linux")) {
|
||||||
mainWindowController.setColor(color);
|
directory = new File(dirLinux);
|
||||||
mainWindowController.setSize(size);
|
settingsFile = new File(dirLinux + "/config.xml");
|
||||||
mainWindowController.setAutoUpdate(autoUpdate);
|
} else {
|
||||||
mainWindowController.setLoaclUI(local);
|
directory = new File(dirWin);
|
||||||
mainWindowController.saveSettings();
|
settingsFile = new File(dirWin + "/config.xml");
|
||||||
Runtime.getRuntime().exec("java -jar ProjectHomeFlix.jar"); //starte neu um Bugs zu verhindern
|
|
||||||
System.exit(0); //beendet sich selbst
|
|
||||||
}else{
|
|
||||||
loadSettings();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
mainWindowController.applyColor(); //setzt die Theme Farbe
|
posterCache = new File(directory+"/posterCache");
|
||||||
mainWindowController.cbLocal.getSelectionModel().select(mainWindowController.getLocal()); //setzt local
|
|
||||||
mainWindowController.mainColor.setValue(Color.valueOf(mainWindowController.getColor()));
|
|
||||||
mainWindowController.loadData(); //l<>d die Daten im Controller
|
|
||||||
|
|
||||||
Scene scene = new Scene(pane); //neue Scen um inhalt der stage anzuzeigen
|
if(!settingsFile.exists()){
|
||||||
|
directory.mkdir();
|
||||||
|
mainWindowController.setPath(firstStart());
|
||||||
|
mainWindowController.setStreamingPath(directory.getAbsolutePath());
|
||||||
|
mainWindowController.setColor(COLOR);
|
||||||
|
mainWindowController.setSize(FONT_SIZE);
|
||||||
|
mainWindowController.setAutoUpdate(AUTO_UPDATE);
|
||||||
|
mainWindowController.setLocal(local);
|
||||||
|
mainWindowController.setMode(mode);
|
||||||
|
mainWindowController.saveSettings();
|
||||||
|
Runtime.getRuntime().exec("java -jar ProjectHomeFlix.jar"); //start again (preventing Bugs)
|
||||||
|
System.exit(0); //finishes it self
|
||||||
|
}
|
||||||
|
|
||||||
primaryStage.setScene(scene);
|
if(!posterCache.exists()) {
|
||||||
primaryStage.show(); //zeige scene
|
posterCache.mkdir();
|
||||||
|
}
|
||||||
|
|
||||||
|
mainWindowController.loadSettings();
|
||||||
|
mainWindowController.loadStreamingSettings();
|
||||||
|
mainWindowController.initUI();
|
||||||
|
mainWindowController.initActions();
|
||||||
|
mainWindowController.initTabel();
|
||||||
|
mainWindowController.setLocalUI();
|
||||||
|
mainWindowController.applyColor(); //set theme color
|
||||||
|
|
||||||
|
mainWindowController.dbController.main(); //initialize database controller
|
||||||
|
mainWindowController.dbController.createDatabase(); //creating the database
|
||||||
|
mainWindowController.dbController.loadData(); //loading data from database to mainWindowController
|
||||||
|
mainWindowController.addDataUI();
|
||||||
|
|
||||||
|
Scene scene = new Scene(pane); //create new scene, append pane to scene
|
||||||
|
|
||||||
|
primaryStage.setScene(scene); //append scene to stage
|
||||||
|
primaryStage.show(); //show stage
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
// Auto-generated catch block
|
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//methode f<EFBFBD>r den erstmaligen Start
|
//Method for first Start
|
||||||
private String firstStart(){
|
private String firstStart(){
|
||||||
Alert alert = new Alert(AlertType.CONFIRMATION); //neuer alert mit filechooser
|
MainWindowController.firststart = true;
|
||||||
|
switch(System.getProperty("user.language")+"_"+System.getProperty("user.country")){
|
||||||
|
case "en_US": bundle = ResourceBundle.getBundle("recources.HomeFlix-Local", Locale.US); //us_english
|
||||||
|
break;
|
||||||
|
case "de_DE": bundle = ResourceBundle.getBundle("recources.HomeFlix-Local", Locale.GERMAN); //German
|
||||||
|
break;
|
||||||
|
default: bundle = ResourceBundle.getBundle("recources.HomeFlix-Local", Locale.US); //default local
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
Alert alert = new Alert(AlertType.CONFIRMATION); //new alert with file-chooser
|
||||||
alert.setTitle("Project HomeFlix");
|
alert.setTitle("Project HomeFlix");
|
||||||
alert.setHeaderText("Es ist kein Stammverzeichniss f<>r Filme angegeben!");
|
alert.setHeaderText(bundle.getString("firstStartHeader"));
|
||||||
alert.setContentText("Stammverzeichniss angeben?");
|
alert.setContentText(bundle.getString("firstStartContent"));
|
||||||
|
|
||||||
Optional<ButtonType> result = alert.showAndWait();
|
Optional<ButtonType> result = alert.showAndWait();
|
||||||
if (result.get() == ButtonType.OK){
|
if (result.get() == ButtonType.OK){
|
||||||
@ -122,27 +167,23 @@ public class Main extends Application {
|
|||||||
return path;
|
return path;
|
||||||
}
|
}
|
||||||
|
|
||||||
//l<>dt die einstellungen aus der XML
|
|
||||||
public void loadSettings(){
|
|
||||||
File configFile = new File("config.xml");
|
|
||||||
try {
|
|
||||||
InputStream inputStream = new FileInputStream(configFile);
|
|
||||||
props.loadFromXML(inputStream);
|
|
||||||
path = props.getProperty("path");
|
|
||||||
color = props.getProperty("color");
|
|
||||||
autoUpdate = props.getProperty("autoUpdate");
|
|
||||||
size = Double.parseDouble(props.getProperty("size"));
|
|
||||||
local = Integer.parseInt(props.getProperty("local"));
|
|
||||||
|
|
||||||
inputStream.close();
|
|
||||||
} catch (IOException e) {
|
|
||||||
// Auto-generated catch block
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public static void main(String[] args) {
|
public static void main(String[] args) {
|
||||||
launch(args);
|
launch(args);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getFONT_FAMILY() {
|
||||||
|
return FONT_FAMILY;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setFONT_FAMILY(String FONT_FAMILY) {
|
||||||
|
this.FONT_FAMILY = FONT_FAMILY;
|
||||||
|
}
|
||||||
|
|
||||||
|
public File getPosterCache() {
|
||||||
|
return posterCache;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPosterCache(File posterCache) {
|
||||||
|
this.posterCache = posterCache;
|
||||||
|
}
|
||||||
}
|
}
|
@ -1,24 +1,32 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
|
||||||
<?import com.jfoenix.controls.JFXButton?>
|
<?import com.jfoenix.controls.JFXButton?>
|
||||||
<?import com.jfoenix.controls.JFXTextArea?>
|
<?import com.jfoenix.controls.JFXColorPicker?>
|
||||||
|
<?import com.jfoenix.controls.JFXSlider?>
|
||||||
<?import com.jfoenix.controls.JFXTextField?>
|
<?import com.jfoenix.controls.JFXTextField?>
|
||||||
|
<?import com.jfoenix.controls.JFXToggleButton?>
|
||||||
|
<?import javafx.scene.control.ChoiceBox?>
|
||||||
|
<?import javafx.scene.control.Label?>
|
||||||
|
<?import javafx.scene.control.ScrollPane?>
|
||||||
|
<?import javafx.scene.control.TableView?>
|
||||||
<?import javafx.scene.control.TreeTableView?>
|
<?import javafx.scene.control.TreeTableView?>
|
||||||
|
<?import javafx.scene.image.Image?>
|
||||||
<?import javafx.scene.image.ImageView?>
|
<?import javafx.scene.image.ImageView?>
|
||||||
<?import javafx.scene.layout.AnchorPane?>
|
<?import javafx.scene.layout.AnchorPane?>
|
||||||
|
<?import javafx.scene.layout.HBox?>
|
||||||
<?import javafx.scene.layout.VBox?>
|
<?import javafx.scene.layout.VBox?>
|
||||||
<?import javafx.scene.text.Font?>
|
<?import javafx.scene.text.Font?>
|
||||||
|
<?import javafx.scene.text.TextFlow?>
|
||||||
|
|
||||||
<AnchorPane fx:id="anpane" prefHeight="600.0" prefWidth="900.0" xmlns="http://javafx.com/javafx/8.0.60" xmlns:fx="http://javafx.com/fxml/1" fx:controller="application.MainWindowController">
|
<AnchorPane fx:id="anpane" prefHeight="600.0" prefWidth="950.0" xmlns="http://javafx.com/javafx/8.0.111" xmlns:fx="http://javafx.com/fxml/1" fx:controller="application.MainWindowController">
|
||||||
<children>
|
<children>
|
||||||
<VBox fx:id="topVBox" prefHeight="32.0" prefWidth="800.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0">
|
<ScrollPane fx:id="scrollPane" fitToWidth="true" layoutX="408.0" layoutY="44.0" prefHeight="544.0" prefWidth="320.0" AnchorPane.bottomAnchor="12.0" AnchorPane.leftAnchor="408.0" AnchorPane.rightAnchor="222.0" AnchorPane.topAnchor="44.0">
|
||||||
<children>
|
<content>
|
||||||
<JFXButton fx:id="menubtn" onAction="#menubtnclicked" prefHeight="32.0" prefWidth="67.0" text="Menu" />
|
<TextFlow fx:id="textFlow" accessibleRole="TEXT_AREA" maxHeight="544.0" maxWidth="320.0" visible="true" />
|
||||||
</children>
|
</content>
|
||||||
</VBox>
|
</ScrollPane>
|
||||||
<TreeTableView fx:id="treeTableViewfilm" layoutX="14.0" layoutY="88.0" prefHeight="400.0" prefWidth="360.0" AnchorPane.bottomAnchor="12.0" AnchorPane.leftAnchor="12.0" AnchorPane.topAnchor="88.0" />
|
<TreeTableView fx:id="treeTableViewfilm" layoutX="14.0" layoutY="88.0" prefHeight="500.0" prefWidth="375.0" AnchorPane.bottomAnchor="12.0" AnchorPane.leftAnchor="12.0" AnchorPane.rightAnchor="568.0" AnchorPane.topAnchor="88.0" />
|
||||||
<JFXTextArea fx:id="ta1" layoutX="385.0" layoutY="42.0" maxWidth="503.0" minWidth="275.0" prefHeight="546.0" prefWidth="293.0" AnchorPane.bottomAnchor="12.0" AnchorPane.leftAnchor="385.0" AnchorPane.rightAnchor="222.0" AnchorPane.topAnchor="44.0" />
|
<JFXButton fx:id="playbtn" contentDisplay="CENTER" layoutX="690.0" layoutY="363.0" onAction="#playbtnclicked" prefHeight="25.0" prefWidth="198.0" AnchorPane.bottomAnchor="212.0" AnchorPane.rightAnchor="12.0">
|
||||||
<JFXButton fx:id="playbtn" layoutX="690.0" layoutY="363.0" onAction="#playbtnclicked" prefHeight="25.0" prefWidth="198.0" text="play" AnchorPane.bottomAnchor="212.0" AnchorPane.rightAnchor="12.0">
|
|
||||||
<font>
|
<font>
|
||||||
<Font name="System Bold" size="14.0" />
|
<Font name="System Bold" size="14.0" />
|
||||||
</font></JFXButton>
|
</font></JFXButton>
|
||||||
@ -26,12 +34,69 @@
|
|||||||
<font>
|
<font>
|
||||||
<Font name="System Bold" size="14.0" />
|
<Font name="System Bold" size="14.0" />
|
||||||
</font></JFXButton>
|
</font></JFXButton>
|
||||||
<JFXTextField fx:id="tfsearch" layoutX="12.0" layoutY="44.0" maxWidth="477.0" minWidth="359.0" prefHeight="31.0" prefWidth="359.0" promptText="Suche ..." AnchorPane.leftAnchor="12.0" AnchorPane.topAnchor="44.0">
|
<JFXTextField fx:id="tfsearch" layoutX="12.0" layoutY="44.0" maxWidth="477.0" minWidth="359.0" prefHeight="31.0" prefWidth="370.0" promptText="Suche ..." AnchorPane.leftAnchor="12.0" AnchorPane.rightAnchor="568.0" AnchorPane.topAnchor="44.0">
|
||||||
<font>
|
<font>
|
||||||
<Font name="Arial" size="12.0" />
|
<Font name="Arial" size="12.0" />
|
||||||
</font></JFXTextField>
|
</font></JFXTextField>
|
||||||
<ImageView fx:id="image1" fitHeight="297.0" fitWidth="198.0" layoutX="481.0" layoutY="46.0" pickOnBounds="true" preserveRatio="true" AnchorPane.rightAnchor="12.0" AnchorPane.topAnchor="44.0" />
|
<ImageView fx:id="image1" fitHeight="297.0" fitWidth="198.0" layoutX="481.0" layoutY="46.0" pickOnBounds="true" preserveRatio="true" AnchorPane.rightAnchor="12.0" AnchorPane.topAnchor="44.0">
|
||||||
<JFXButton fx:id="returnBtn" layoutX="690.0" layoutY="443.0" onAction="#returnBtnclicked" prefHeight="25.0" prefWidth="90.0" text="<<" AnchorPane.bottomAnchor="132.0" AnchorPane.rightAnchor="120.0" />
|
<image>
|
||||||
<JFXButton fx:id="forwardBtn" layoutX="798.0" layoutY="443.0" onAction="#forwardBtnclicked" prefHeight="25.0" prefWidth="90.0" text=">>" AnchorPane.bottomAnchor="132.0" AnchorPane.rightAnchor="12.0" />
|
<Image url="@../recources/Homeflix_Poster.png" />
|
||||||
|
</image></ImageView>
|
||||||
|
<JFXButton fx:id="returnBtn" contentDisplay="CENTER" layoutX="690.0" layoutY="443.0" onAction="#returnBtnclicked" prefHeight="25.0" prefWidth="90.0" AnchorPane.bottomAnchor="132.0" AnchorPane.rightAnchor="120.0" />
|
||||||
|
<JFXButton fx:id="forwardBtn" contentDisplay="CENTER" layoutX="798.0" layoutY="443.0" onAction="#forwardBtnclicked" prefHeight="25.0" prefWidth="90.0" AnchorPane.bottomAnchor="132.0" AnchorPane.rightAnchor="12.0" />
|
||||||
|
<HBox fx:id="topHBox" layoutY="12.0" prefHeight="32.0" prefWidth="900.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0">
|
||||||
|
<children>
|
||||||
|
<JFXButton fx:id="menubtn" onAction="#menubtnclicked" prefHeight="32.0" prefWidth="32.0" />
|
||||||
|
</children>
|
||||||
|
</HBox>
|
||||||
|
<VBox fx:id="sideMenuVBox" layoutY="32.0" prefHeight="660.0" prefWidth="150.0" visible="false" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.topAnchor="38.0">
|
||||||
|
<children>
|
||||||
|
<JFXButton fx:id="infoBtn" onAction="#infoBtnclicked" prefHeight="32.0" prefWidth="150.0" textAlignment="CENTER">
|
||||||
|
<font>
|
||||||
|
<Font name="System Bold" size="15.0" />
|
||||||
|
</font>
|
||||||
|
</JFXButton>
|
||||||
|
<JFXButton fx:id="settingsBtn" onAction="#settingsBtnclicked" prefHeight="37.0" prefWidth="150.0" textAlignment="CENTER">
|
||||||
|
<font>
|
||||||
|
<Font name="System Bold" size="15.0" />
|
||||||
|
</font>
|
||||||
|
</JFXButton>
|
||||||
|
<JFXButton fx:id="streamingSettingsBtn" onAction="#streamingSettingsBtnclicked" prefHeight="32.0" prefWidth="150.0" textAlignment="CENTER">
|
||||||
|
<font>
|
||||||
|
<Font name="System Bold" size="15.0" />
|
||||||
|
</font>
|
||||||
|
</JFXButton>
|
||||||
|
<JFXButton fx:id="switchBtn" onAction="#switchBtnclicked" prefHeight="32.0" prefWidth="150.0" textAlignment="CENTER">
|
||||||
|
<font>
|
||||||
|
<Font name="System Bold" size="15.0" />
|
||||||
|
</font>
|
||||||
|
</JFXButton>
|
||||||
|
<JFXButton fx:id="debugBtn" onAction="#debugBtnclicked" prefHeight="32.0" prefWidth="150.0" text="debugging" textAlignment="CENTER">
|
||||||
|
<font>
|
||||||
|
<Font name="System Bold" size="15.0" />
|
||||||
|
</font>
|
||||||
|
</JFXButton>
|
||||||
|
</children>
|
||||||
|
</VBox>
|
||||||
|
<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" 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>
|
||||||
|
<JFXTextField fx:id="tfPath" layoutX="14.0" layoutY="14.0" onAction="#tfPathAction" prefWidth="250.0" AnchorPane.leftAnchor="5.0" AnchorPane.topAnchor="5.0" />
|
||||||
|
<JFXButton fx:id="directoryBtn" layoutX="255.0" layoutY="8.0" onAction="#directoryBtnAction" prefHeight="25.0" AnchorPane.leftAnchor="260.0" />
|
||||||
|
<JFXColorPicker fx:id="mainColor" layoutX="14.0" layoutY="45.0" onAction="#mainColorAction" AnchorPane.leftAnchor="5.0" AnchorPane.topAnchor="40.0" />
|
||||||
|
<Label fx:id="sizelbl" layoutY="73.0" text="Label" AnchorPane.leftAnchor="5.0" AnchorPane.topAnchor="75.0" />
|
||||||
|
<JFXSlider fx:id="sliderFontSize" layoutX="10.0" layoutY="99.0" max="48.0" min="2.0" prefWidth="250.0" AnchorPane.leftAnchor="5.0" AnchorPane.topAnchor="110.0" />
|
||||||
|
<ChoiceBox fx:id="cbLocal" layoutX="14.0" layoutY="131.0" prefWidth="150.0" AnchorPane.leftAnchor="5.0" AnchorPane.topAnchor="145.0" />
|
||||||
|
<JFXButton fx:id="updateBtn" layoutX="7.0" layoutY="177.0" onAction="#updateBtnAction" AnchorPane.leftAnchor="5.0" AnchorPane.topAnchor="180.0" />
|
||||||
|
<Label fx:id="aulbl" layoutX="43.0" layoutY="219.0" text="Label" AnchorPane.leftAnchor="5.0" AnchorPane.topAnchor="215.0" />
|
||||||
|
<JFXToggleButton fx:id="autoupdateBtn" layoutX="19.0" layoutY="215.0" onAction="#autoupdateBtnAction" AnchorPane.leftAnchor="5.0" AnchorPane.topAnchor="230.0" />
|
||||||
|
<Label fx:id="versionlbl" layoutX="29.0" layoutY="297.0" text="Label" AnchorPane.leftAnchor="5.0" AnchorPane.topAnchor="280.0" />
|
||||||
|
</children>
|
||||||
|
</AnchorPane>
|
||||||
</children>
|
</children>
|
||||||
</AnchorPane>
|
</AnchorPane>
|
||||||
|
211
src/application/apiQuery.java
Normal file
@ -0,0 +1,211 @@
|
|||||||
|
/**
|
||||||
|
* apiQuery for Project HomeFlix
|
||||||
|
* sends a query to the omdb api
|
||||||
|
*/
|
||||||
|
package application;
|
||||||
|
|
||||||
|
import java.awt.Graphics2D;
|
||||||
|
import java.awt.image.BufferedImage;
|
||||||
|
import java.io.BufferedReader;
|
||||||
|
import java.io.File;
|
||||||
|
import java.io.InputStream;
|
||||||
|
import java.io.InputStreamReader;
|
||||||
|
import java.net.URL;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Scanner;
|
||||||
|
|
||||||
|
import javax.imageio.ImageIO;
|
||||||
|
|
||||||
|
import com.eclipsesource.json.Json;
|
||||||
|
import com.eclipsesource.json.JsonObject;
|
||||||
|
|
||||||
|
import javafx.scene.image.Image;
|
||||||
|
import javafx.scene.text.Font;
|
||||||
|
import javafx.scene.text.FontWeight;
|
||||||
|
import javafx.scene.text.Text;
|
||||||
|
|
||||||
|
public class apiQuery{
|
||||||
|
|
||||||
|
public apiQuery(MainWindowController m, DBController db, Main main){
|
||||||
|
mainWindowController=m;
|
||||||
|
dbController=db;
|
||||||
|
this.main = main;
|
||||||
|
}
|
||||||
|
|
||||||
|
private MainWindowController mainWindowController;
|
||||||
|
private DBController dbController;
|
||||||
|
private Main main;
|
||||||
|
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 queryURL = null;
|
||||||
|
Scanner sc = null;
|
||||||
|
String moviename = null;
|
||||||
|
String retdata = null;
|
||||||
|
String posterPath = null;
|
||||||
|
InputStream is = null;
|
||||||
|
BufferedReader br = null;
|
||||||
|
String fontFamily = main.getFONT_FAMILY();
|
||||||
|
posterCache = main.getPosterCache().toString();
|
||||||
|
int fontSize = (int) Math.round(mainWindowController.size);
|
||||||
|
|
||||||
|
responseText.removeAll(responseText);
|
||||||
|
nameText.removeAll(nameText);
|
||||||
|
|
||||||
|
try {
|
||||||
|
|
||||||
|
//get film title
|
||||||
|
sc = new Scanner(System.in);
|
||||||
|
moviename = titel;
|
||||||
|
|
||||||
|
// in case of no or "" Film title
|
||||||
|
if (moviename == null || moviename.equals("")) {
|
||||||
|
System.out.println("No movie found");
|
||||||
|
}
|
||||||
|
|
||||||
|
//remove unwanted blank
|
||||||
|
moviename = moviename.trim();
|
||||||
|
|
||||||
|
//replace blank with +
|
||||||
|
moviename = moviename.replace(" ", "+");
|
||||||
|
|
||||||
|
//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
|
||||||
|
while ((retdata = br.readLine()) != null) {
|
||||||
|
//cut the json response into separate strings
|
||||||
|
System.out.println(retdata);
|
||||||
|
JsonObject object = Json.parse(retdata).asObject();
|
||||||
|
|
||||||
|
responseString[0] = object.getString("Title", "");
|
||||||
|
responseString[1] = object.getString("Year", "");
|
||||||
|
responseString[2] = object.getString("Rated", "");
|
||||||
|
responseString[3] = object.getString("Released", "");
|
||||||
|
responseString[4] = object.getString("Runtime", "");
|
||||||
|
responseString[5] = object.getString("Genre", "");
|
||||||
|
responseString[6] = object.getString("Director", "");
|
||||||
|
responseString[7] = object.getString("Writer", "");
|
||||||
|
responseString[8] = object.getString("Actors", "");
|
||||||
|
responseString[9] = object.getString("Plot", "");
|
||||||
|
responseString[10] = object.getString("Language", "");
|
||||||
|
responseString[11] = object.getString("Country", "");
|
||||||
|
responseString[12] = object.getString("Awards", "");
|
||||||
|
responseString[13] = object.getString("Metascore", "");
|
||||||
|
responseString[14] = object.getString("imdbRating", "");
|
||||||
|
responseString[15] = object.getString("Type", "");
|
||||||
|
responseString[16] = object.getString("imdbVotes", "");
|
||||||
|
responseString[17] = object.getString("imdbID", "");
|
||||||
|
responseString[18] = object.getString("Poster", "");
|
||||||
|
responseString[19] = object.getString("Response", "");
|
||||||
|
|
||||||
|
//adding poster to cache
|
||||||
|
BufferedImage originalImage = ImageIO.read(new URL(responseString[18]));//change path to where file is located
|
||||||
|
int type = originalImage.getType() == 0 ? BufferedImage.TYPE_INT_ARGB : originalImage.getType();
|
||||||
|
BufferedImage resizeImagePNG = resizeImage(originalImage, type, 198, 297);
|
||||||
|
if(System.getProperty("os.name").equals("Linux")) {
|
||||||
|
posterPath = posterCache+"/"+titel+".png";
|
||||||
|
ImageIO.write(resizeImagePNG, "png", new File(posterCache+"/"+titel+".png")); //change path where you want it saved
|
||||||
|
} else {
|
||||||
|
ImageIO.write(resizeImagePNG, "png", new File(posterCache+"\\"+titel+".png")); //change path where you want it saved
|
||||||
|
posterPath = posterCache+"\\"+titel+".png";
|
||||||
|
}
|
||||||
|
System.out.println("adding poster to cache: "+posterPath);
|
||||||
|
|
||||||
|
//adding strings to the cache
|
||||||
|
dbController.addCache( streamUrl, responseString[0], responseString[1],responseString[2], responseString[3], responseString[4], responseString[5],
|
||||||
|
responseString[6], responseString[7], responseString[8], responseString[9], responseString[10],responseString[11], responseString[12],
|
||||||
|
responseString[13], responseString[14], responseString[15], responseString[16], responseString[17], posterPath,
|
||||||
|
responseString[19]);
|
||||||
|
dbController.setCached(streamUrl);
|
||||||
|
|
||||||
|
for(int i=0; i<20; i++){
|
||||||
|
Text text = new Text(responseString[i]+"\n");
|
||||||
|
responseText.add(text);
|
||||||
|
responseText.get(i).setFont(Font.font(fontFamily, fontSize));
|
||||||
|
}
|
||||||
|
|
||||||
|
//if response == false then show mainWindowController.noFilmFound else create new Texts and add them to flowText
|
||||||
|
if(responseString[19].equals("False")){
|
||||||
|
mainWindowController.textFlow.getChildren().add(new Text(mainWindowController.noFilmFound));
|
||||||
|
im = new Image("recources/icons/close_black_2048x2048.png");
|
||||||
|
mainWindowController.image1.setImage(im);
|
||||||
|
}else{
|
||||||
|
//
|
||||||
|
nameText.add(0, new Text(mainWindowController.title+": "));
|
||||||
|
nameText.add(1, new Text(mainWindowController.year+": "));
|
||||||
|
nameText.add(2, new Text(mainWindowController.rating+": "));
|
||||||
|
nameText.add(3, new Text(mainWindowController.publishedOn+": "));
|
||||||
|
nameText.add(4, new Text(mainWindowController.duration+": "));
|
||||||
|
nameText.add(5, new Text(mainWindowController.genre+": "));
|
||||||
|
nameText.add(6, new Text(mainWindowController.director+": "));
|
||||||
|
nameText.add(7, new Text(mainWindowController.writer+": "));
|
||||||
|
nameText.add(8, new Text(mainWindowController.actors+": "));
|
||||||
|
nameText.add(9, new Text(mainWindowController.plot+": "));
|
||||||
|
nameText.add(10, new Text(mainWindowController.language+": "));
|
||||||
|
nameText.add(11, new Text(mainWindowController.country+": "));
|
||||||
|
nameText.add(12, new Text(mainWindowController.awards+": "));
|
||||||
|
nameText.add(13, new Text(mainWindowController.metascore+": "));
|
||||||
|
nameText.add(14, new Text(mainWindowController.imdbRating+": "));
|
||||||
|
nameText.add(15, new Text(mainWindowController.type+": "));
|
||||||
|
|
||||||
|
|
||||||
|
for(int i=0; i<nameText.size(); i++){
|
||||||
|
nameText.get(i).setFont(Font.font (fontFamily, FontWeight.BOLD, fontSize));
|
||||||
|
}
|
||||||
|
|
||||||
|
mainWindowController.textFlow.getChildren().remove(0, mainWindowController.textFlow.getChildren().size());
|
||||||
|
|
||||||
|
for(int i=0;i<nameText.size(); i++){
|
||||||
|
mainWindowController.textFlow.getChildren().addAll(nameText.get(i),responseText.get(i));
|
||||||
|
}
|
||||||
|
|
||||||
|
//if there is no poster
|
||||||
|
if(responseString[18].equals("N/A")){
|
||||||
|
im = new Image("recources/icons/close_black_2048x2048.png");
|
||||||
|
}else{
|
||||||
|
im = new Image(responseString[18]);
|
||||||
|
}
|
||||||
|
mainWindowController.image1.setImage(im);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
} catch (Exception e) {
|
||||||
|
mainWindowController.textFlow.getChildren().add(new Text(e.toString()));
|
||||||
|
System.out.println(e);
|
||||||
|
} finally {
|
||||||
|
//closes datainputStream, InputStream,Scanner if not already done
|
||||||
|
try {
|
||||||
|
if (br != null) {
|
||||||
|
br.close();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (is != null) {
|
||||||
|
is.close();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (sc != null) {
|
||||||
|
sc.close();
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private static BufferedImage resizeImage(BufferedImage originalImage, int type, int IMG_WIDTH, int IMG_HEIGHT) {
|
||||||
|
BufferedImage resizedImage = new BufferedImage(IMG_WIDTH, IMG_HEIGHT, type);
|
||||||
|
Graphics2D g = resizedImage.createGraphics();
|
||||||
|
g.drawImage(originalImage, 0, 0, IMG_WIDTH, IMG_HEIGHT, null);
|
||||||
|
g.dispose();
|
||||||
|
|
||||||
|
return resizedImage;
|
||||||
|
}
|
||||||
|
}
|
158
src/application/tableData.java
Normal file
@ -0,0 +1,158 @@
|
|||||||
|
package application;
|
||||||
|
|
||||||
|
import javafx.beans.property.BooleanProperty;
|
||||||
|
import javafx.beans.property.DoubleProperty;
|
||||||
|
import javafx.beans.property.IntegerProperty;
|
||||||
|
import javafx.beans.property.SimpleBooleanProperty;
|
||||||
|
import javafx.beans.property.SimpleDoubleProperty;
|
||||||
|
import javafx.beans.property.SimpleIntegerProperty;
|
||||||
|
import javafx.beans.property.SimpleObjectProperty;
|
||||||
|
import javafx.beans.property.SimpleStringProperty;
|
||||||
|
import javafx.beans.property.StringProperty;
|
||||||
|
import javafx.scene.image.ImageView;
|
||||||
|
|
||||||
|
public class tableData {
|
||||||
|
private final IntegerProperty year = new SimpleIntegerProperty();
|
||||||
|
private final IntegerProperty season = new SimpleIntegerProperty();
|
||||||
|
private final IntegerProperty episode = new SimpleIntegerProperty();
|
||||||
|
private final DoubleProperty rating = new SimpleDoubleProperty();
|
||||||
|
private final StringProperty resolution = new SimpleStringProperty();
|
||||||
|
private final StringProperty title = new SimpleStringProperty();
|
||||||
|
private final StringProperty streamUrl = new SimpleStringProperty();
|
||||||
|
private final SimpleObjectProperty<ImageView> image = new SimpleObjectProperty<>();
|
||||||
|
private final BooleanProperty cached = new SimpleBooleanProperty();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* tableData is the data-type of tree-table-view
|
||||||
|
* @param year: the release year of the film
|
||||||
|
* @param season: season if it's a series
|
||||||
|
* @param episode: episode if it's a series
|
||||||
|
* @param rating: indicator for favourites, used for sorting the items
|
||||||
|
* @param resolution: resolution of the film
|
||||||
|
* @param titel: title of the film
|
||||||
|
* @param streamUrl: the concrete path to the file or the URL
|
||||||
|
* @param image: the favourite icon
|
||||||
|
* @param cached: indicator for caching status
|
||||||
|
*/
|
||||||
|
public tableData (final int year, final int season, final int episode, final double rating, final String resolution, final String title, final String streamUrl, final ImageView image, final boolean cached) {
|
||||||
|
this.year.set(year);
|
||||||
|
this.season.set(season);
|
||||||
|
this.episode.set(episode);
|
||||||
|
this.rating.set(rating);
|
||||||
|
this.resolution.set(resolution);
|
||||||
|
this.title.set(title);
|
||||||
|
this.streamUrl.set(streamUrl);
|
||||||
|
this.image.set(image);
|
||||||
|
this.cached.set(cached);
|
||||||
|
}
|
||||||
|
|
||||||
|
public IntegerProperty yearProperty(){
|
||||||
|
return year;
|
||||||
|
}
|
||||||
|
|
||||||
|
public IntegerProperty seasonProperty(){
|
||||||
|
return season;
|
||||||
|
}
|
||||||
|
|
||||||
|
public IntegerProperty episodeProperty(){
|
||||||
|
return episode;
|
||||||
|
}
|
||||||
|
|
||||||
|
public DoubleProperty ratingProperty(){
|
||||||
|
return rating;
|
||||||
|
}
|
||||||
|
|
||||||
|
public StringProperty resolutionProperty(){
|
||||||
|
return resolution;
|
||||||
|
}
|
||||||
|
|
||||||
|
public StringProperty titleProperty(){
|
||||||
|
return title;
|
||||||
|
}
|
||||||
|
|
||||||
|
public StringProperty streamUrlProperty(){
|
||||||
|
return streamUrl;
|
||||||
|
}
|
||||||
|
|
||||||
|
public SimpleObjectProperty<ImageView> imageProperty(){
|
||||||
|
return image;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BooleanProperty cachedProperty(){
|
||||||
|
return cached;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public final int getYear() {
|
||||||
|
return yearProperty().get();
|
||||||
|
}
|
||||||
|
|
||||||
|
public final int getSeason() {
|
||||||
|
return seasonProperty().get();
|
||||||
|
}
|
||||||
|
|
||||||
|
public final int getEpisode() {
|
||||||
|
return episodeProperty().get();
|
||||||
|
}
|
||||||
|
|
||||||
|
public final double getRating() {
|
||||||
|
return ratingProperty().get();
|
||||||
|
}
|
||||||
|
|
||||||
|
public final String getResolution() {
|
||||||
|
return resolutionProperty().get();
|
||||||
|
}
|
||||||
|
|
||||||
|
public final String getTitle() {
|
||||||
|
return titleProperty().get();
|
||||||
|
}
|
||||||
|
|
||||||
|
public final String getStreamUrl() {
|
||||||
|
return streamUrlProperty().get();
|
||||||
|
}
|
||||||
|
|
||||||
|
public final ImageView getImage() {
|
||||||
|
return imageProperty().get();
|
||||||
|
}
|
||||||
|
|
||||||
|
public final boolean getCached(){
|
||||||
|
return cachedProperty().get();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public final void setYear(int year) {
|
||||||
|
yearProperty().set(year);
|
||||||
|
}
|
||||||
|
|
||||||
|
public final void setSeason(int season) {
|
||||||
|
seasonProperty().set(season);
|
||||||
|
}
|
||||||
|
|
||||||
|
public final void setEpisode(int season) {
|
||||||
|
episodeProperty().set(season);
|
||||||
|
}
|
||||||
|
|
||||||
|
public final void setRating(int rating) {
|
||||||
|
ratingProperty().set(rating);
|
||||||
|
}
|
||||||
|
|
||||||
|
public final void setResolution(String resolution) {
|
||||||
|
resolutionProperty().set(resolution);
|
||||||
|
}
|
||||||
|
|
||||||
|
public final void setTitle(String title) {
|
||||||
|
titleProperty().set(title);
|
||||||
|
}
|
||||||
|
|
||||||
|
public final void setStreamUrl(String streamUrl) {
|
||||||
|
streamUrlProperty().set(streamUrl);
|
||||||
|
}
|
||||||
|
|
||||||
|
public final void setImage(ImageView image) {
|
||||||
|
imageProperty().set(image);
|
||||||
|
}
|
||||||
|
|
||||||
|
public final void setCached(boolean cached){
|
||||||
|
cachedProperty().set(cached);
|
||||||
|
}
|
||||||
|
}
|
@ -1,57 +0,0 @@
|
|||||||
package application;
|
|
||||||
|
|
||||||
import javafx.beans.property.DoubleProperty;
|
|
||||||
import javafx.beans.property.SimpleDoubleProperty;
|
|
||||||
import javafx.beans.property.SimpleStringProperty;
|
|
||||||
import javafx.beans.property.StringProperty;
|
|
||||||
|
|
||||||
public class uiData {
|
|
||||||
|
|
||||||
private DoubleProperty filmBewertung = new SimpleDoubleProperty();
|
|
||||||
private StringProperty filmName = new SimpleStringProperty();
|
|
||||||
private StringProperty dataName = new SimpleStringProperty();
|
|
||||||
|
|
||||||
//uiData ist der Typ der Daten in der TreeTabelView
|
|
||||||
public uiData (final Double filmBewertung, final String filmName, final String dataName) {
|
|
||||||
this.filmBewertung.set(filmBewertung);
|
|
||||||
this.filmName.set(filmName);
|
|
||||||
this.dataName.set(dataName);
|
|
||||||
}
|
|
||||||
|
|
||||||
public Double getFilmBewertung() {
|
|
||||||
return filmBewertung.get();
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getFilmName() {
|
|
||||||
return filmName.get();
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getDataName() {
|
|
||||||
return dataName.get();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public void setFilmBewertung(Double filmBewertung) {
|
|
||||||
this.filmBewertung.set(filmBewertung);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setFilmName(String filmName) {
|
|
||||||
this.filmName.set(filmName);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setDataName(StringProperty dataName) {
|
|
||||||
this.dataName = dataName;
|
|
||||||
}
|
|
||||||
|
|
||||||
public DoubleProperty FilmBewertungProperty(){
|
|
||||||
return filmBewertung;
|
|
||||||
}
|
|
||||||
|
|
||||||
public StringProperty FilmNameProperty(){
|
|
||||||
return filmName;
|
|
||||||
}
|
|
||||||
|
|
||||||
public StringProperty DataNameProperty(){
|
|
||||||
return dataName;
|
|
||||||
}
|
|
||||||
}
|
|
88
src/application/updater.java
Normal file
@ -0,0 +1,88 @@
|
|||||||
|
/**
|
||||||
|
* updater for Project HomeFlix
|
||||||
|
* checks for Updates and downloads it in case there is one
|
||||||
|
*/
|
||||||
|
package application;
|
||||||
|
|
||||||
|
import java.io.BufferedReader;
|
||||||
|
import java.io.File;
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.io.InputStreamReader;
|
||||||
|
import java.net.HttpURLConnection;
|
||||||
|
import java.net.URL;
|
||||||
|
import javax.swing.ProgressMonitor;
|
||||||
|
import javax.swing.ProgressMonitorInputStream;
|
||||||
|
|
||||||
|
import org.apache.commons.io.FileUtils;
|
||||||
|
|
||||||
|
import javafx.application.Platform;
|
||||||
|
|
||||||
|
public class updater extends Thread{
|
||||||
|
|
||||||
|
private MainWindowController mainWindowController;
|
||||||
|
private String buildURL;
|
||||||
|
private String downloadLink;
|
||||||
|
private String updateBuildNumber;
|
||||||
|
private String buildNumber;
|
||||||
|
|
||||||
|
public updater(MainWindowController m, String buildURL,String downloadLink,String buildNumber){
|
||||||
|
mainWindowController=m;
|
||||||
|
this.buildURL=buildURL;
|
||||||
|
this.downloadLink=downloadLink;
|
||||||
|
this.buildNumber=buildNumber;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void run(){
|
||||||
|
System.out.println("check for updates ...");
|
||||||
|
Platform.runLater(() -> {
|
||||||
|
mainWindowController.updateBtn.setText(mainWindowController.bundle.getString("checkingUpdates"));
|
||||||
|
});
|
||||||
|
try {
|
||||||
|
URL url = new URL(buildURL); //URL of the text file with the current build number
|
||||||
|
BufferedReader in = new BufferedReader(new InputStreamReader(url.openStream()));
|
||||||
|
updateBuildNumber = in.readLine(); //write InputStream in String
|
||||||
|
in.close();
|
||||||
|
} catch (IOException e1) {
|
||||||
|
mainWindowController.showErrorMsg(mainWindowController.errorUpdateV, e1);
|
||||||
|
}
|
||||||
|
System.out.println("Build: "+buildNumber+", Update: "+updateBuildNumber);
|
||||||
|
|
||||||
|
//Compares the program BuildNumber with the current BuildNumber if program BuildNumber < current BuildNumber then perform a update
|
||||||
|
int iversion = Integer.parseInt(buildNumber);
|
||||||
|
int iaktVersion = Integer.parseInt(updateBuildNumber.replace(".", ""));
|
||||||
|
|
||||||
|
if(iversion >= iaktVersion){
|
||||||
|
Platform.runLater(() -> {
|
||||||
|
mainWindowController.updateBtn.setText(mainWindowController.bundle.getString("updateBtnNotavail"));
|
||||||
|
});
|
||||||
|
System.out.println("no update available");
|
||||||
|
}else{
|
||||||
|
Platform.runLater(() -> {
|
||||||
|
mainWindowController.updateBtn.setText(mainWindowController.bundle.getString("updateBtnavail"));
|
||||||
|
});
|
||||||
|
System.out.println("update available");
|
||||||
|
try {
|
||||||
|
//get the download-Data URL
|
||||||
|
URL downloadURL = new URL(downloadLink);
|
||||||
|
BufferedReader in = new BufferedReader(new InputStreamReader(downloadURL.openStream()));
|
||||||
|
String updateDataURL = in.readLine();
|
||||||
|
|
||||||
|
//open new Http connection, ProgressMonitorInputStream for downloading the data
|
||||||
|
HttpURLConnection conn = (HttpURLConnection) new URL(updateDataURL).openConnection();
|
||||||
|
ProgressMonitorInputStream pmis = new ProgressMonitorInputStream(null, "Downloading...", conn.getInputStream());
|
||||||
|
ProgressMonitor pm = pmis.getProgressMonitor();
|
||||||
|
pm.setMillisToDecideToPopup(0);
|
||||||
|
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"));
|
||||||
|
|
||||||
|
Runtime.getRuntime().exec("java -jar ProjectHomeFlix.jar"); //start again
|
||||||
|
System.exit(0); //finishes itself
|
||||||
|
} catch (IOException e) {
|
||||||
|
//in case there is an error
|
||||||
|
mainWindowController.showErrorMsg(mainWindowController.errorUpdateD, e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
202
src/libraries/Licenses/Apache_License.txt
Normal file
@ -0,0 +1,202 @@
|
|||||||
|
|
||||||
|
Apache License
|
||||||
|
Version 2.0, January 2004
|
||||||
|
http://www.apache.org/licenses/
|
||||||
|
|
||||||
|
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
||||||
|
|
||||||
|
1. Definitions.
|
||||||
|
|
||||||
|
"License" shall mean the terms and conditions for use, reproduction,
|
||||||
|
and distribution as defined by Sections 1 through 9 of this document.
|
||||||
|
|
||||||
|
"Licensor" shall mean the copyright owner or entity authorized by
|
||||||
|
the copyright owner that is granting the License.
|
||||||
|
|
||||||
|
"Legal Entity" shall mean the union of the acting entity and all
|
||||||
|
other entities that control, are controlled by, or are under common
|
||||||
|
control with that entity. For the purposes of this definition,
|
||||||
|
"control" means (i) the power, direct or indirect, to cause the
|
||||||
|
direction or management of such entity, whether by contract or
|
||||||
|
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
||||||
|
outstanding shares, or (iii) beneficial ownership of such entity.
|
||||||
|
|
||||||
|
"You" (or "Your") shall mean an individual or Legal Entity
|
||||||
|
exercising permissions granted by this License.
|
||||||
|
|
||||||
|
"Source" form shall mean the preferred form for making modifications,
|
||||||
|
including but not limited to software source code, documentation
|
||||||
|
source, and configuration files.
|
||||||
|
|
||||||
|
"Object" form shall mean any form resulting from mechanical
|
||||||
|
transformation or translation of a Source form, including but
|
||||||
|
not limited to compiled object code, generated documentation,
|
||||||
|
and conversions to other media types.
|
||||||
|
|
||||||
|
"Work" shall mean the work of authorship, whether in Source or
|
||||||
|
Object form, made available under the License, as indicated by a
|
||||||
|
copyright notice that is included in or attached to the work
|
||||||
|
(an example is provided in the Appendix below).
|
||||||
|
|
||||||
|
"Derivative Works" shall mean any work, whether in Source or Object
|
||||||
|
form, that is based on (or derived from) the Work and for which the
|
||||||
|
editorial revisions, annotations, elaborations, or other modifications
|
||||||
|
represent, as a whole, an original work of authorship. For the purposes
|
||||||
|
of this License, Derivative Works shall not include works that remain
|
||||||
|
separable from, or merely link (or bind by name) to the interfaces of,
|
||||||
|
the Work and Derivative Works thereof.
|
||||||
|
|
||||||
|
"Contribution" shall mean any work of authorship, including
|
||||||
|
the original version of the Work and any modifications or additions
|
||||||
|
to that Work or Derivative Works thereof, that is intentionally
|
||||||
|
submitted to Licensor for inclusion in the Work by the copyright owner
|
||||||
|
or by an individual or Legal Entity authorized to submit on behalf of
|
||||||
|
the copyright owner. For the purposes of this definition, "submitted"
|
||||||
|
means any form of electronic, verbal, or written communication sent
|
||||||
|
to the Licensor or its representatives, including but not limited to
|
||||||
|
communication on electronic mailing lists, source code control systems,
|
||||||
|
and issue tracking systems that are managed by, or on behalf of, the
|
||||||
|
Licensor for the purpose of discussing and improving the Work, but
|
||||||
|
excluding communication that is conspicuously marked or otherwise
|
||||||
|
designated in writing by the copyright owner as "Not a Contribution."
|
||||||
|
|
||||||
|
"Contributor" shall mean Licensor and any individual or Legal Entity
|
||||||
|
on behalf of whom a Contribution has been received by Licensor and
|
||||||
|
subsequently incorporated within the Work.
|
||||||
|
|
||||||
|
2. Grant of Copyright License. Subject to the terms and conditions of
|
||||||
|
this License, each Contributor hereby grants to You a perpetual,
|
||||||
|
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||||
|
copyright license to reproduce, prepare Derivative Works of,
|
||||||
|
publicly display, publicly perform, sublicense, and distribute the
|
||||||
|
Work and such Derivative Works in Source or Object form.
|
||||||
|
|
||||||
|
3. Grant of Patent License. Subject to the terms and conditions of
|
||||||
|
this License, each Contributor hereby grants to You a perpetual,
|
||||||
|
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||||
|
(except as stated in this section) patent license to make, have made,
|
||||||
|
use, offer to sell, sell, import, and otherwise transfer the Work,
|
||||||
|
where such license applies only to those patent claims licensable
|
||||||
|
by such Contributor that are necessarily infringed by their
|
||||||
|
Contribution(s) alone or by combination of their Contribution(s)
|
||||||
|
with the Work to which such Contribution(s) was submitted. If You
|
||||||
|
institute patent litigation against any entity (including a
|
||||||
|
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
||||||
|
or a Contribution incorporated within the Work constitutes direct
|
||||||
|
or contributory patent infringement, then any patent licenses
|
||||||
|
granted to You under this License for that Work shall terminate
|
||||||
|
as of the date such litigation is filed.
|
||||||
|
|
||||||
|
4. Redistribution. You may reproduce and distribute copies of the
|
||||||
|
Work or Derivative Works thereof in any medium, with or without
|
||||||
|
modifications, and in Source or Object form, provided that You
|
||||||
|
meet the following conditions:
|
||||||
|
|
||||||
|
(a) You must give any other recipients of the Work or
|
||||||
|
Derivative Works a copy of this License; and
|
||||||
|
|
||||||
|
(b) You must cause any modified files to carry prominent notices
|
||||||
|
stating that You changed the files; and
|
||||||
|
|
||||||
|
(c) You must retain, in the Source form of any Derivative Works
|
||||||
|
that You distribute, all copyright, patent, trademark, and
|
||||||
|
attribution notices from the Source form of the Work,
|
||||||
|
excluding those notices that do not pertain to any part of
|
||||||
|
the Derivative Works; and
|
||||||
|
|
||||||
|
(d) If the Work includes a "NOTICE" text file as part of its
|
||||||
|
distribution, then any Derivative Works that You distribute must
|
||||||
|
include a readable copy of the attribution notices contained
|
||||||
|
within such NOTICE file, excluding those notices that do not
|
||||||
|
pertain to any part of the Derivative Works, in at least one
|
||||||
|
of the following places: within a NOTICE text file distributed
|
||||||
|
as part of the Derivative Works; within the Source form or
|
||||||
|
documentation, if provided along with the Derivative Works; or,
|
||||||
|
within a display generated by the Derivative Works, if and
|
||||||
|
wherever such third-party notices normally appear. The contents
|
||||||
|
of the NOTICE file are for informational purposes only and
|
||||||
|
do not modify the License. You may add Your own attribution
|
||||||
|
notices within Derivative Works that You distribute, alongside
|
||||||
|
or as an addendum to the NOTICE text from the Work, provided
|
||||||
|
that such additional attribution notices cannot be construed
|
||||||
|
as modifying the License.
|
||||||
|
|
||||||
|
You may add Your own copyright statement to Your modifications and
|
||||||
|
may provide additional or different license terms and conditions
|
||||||
|
for use, reproduction, or distribution of Your modifications, or
|
||||||
|
for any such Derivative Works as a whole, provided Your use,
|
||||||
|
reproduction, and distribution of the Work otherwise complies with
|
||||||
|
the conditions stated in this License.
|
||||||
|
|
||||||
|
5. Submission of Contributions. Unless You explicitly state otherwise,
|
||||||
|
any Contribution intentionally submitted for inclusion in the Work
|
||||||
|
by You to the Licensor shall be under the terms and conditions of
|
||||||
|
this License, without any additional terms or conditions.
|
||||||
|
Notwithstanding the above, nothing herein shall supersede or modify
|
||||||
|
the terms of any separate license agreement you may have executed
|
||||||
|
with Licensor regarding such Contributions.
|
||||||
|
|
||||||
|
6. Trademarks. This License does not grant permission to use the trade
|
||||||
|
names, trademarks, service marks, or product names of the Licensor,
|
||||||
|
except as required for reasonable and customary use in describing the
|
||||||
|
origin of the Work and reproducing the content of the NOTICE file.
|
||||||
|
|
||||||
|
7. Disclaimer of Warranty. Unless required by applicable law or
|
||||||
|
agreed to in writing, Licensor provides the Work (and each
|
||||||
|
Contributor provides its Contributions) on an "AS IS" BASIS,
|
||||||
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||||
|
implied, including, without limitation, any warranties or conditions
|
||||||
|
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
||||||
|
PARTICULAR PURPOSE. You are solely responsible for determining the
|
||||||
|
appropriateness of using or redistributing the Work and assume any
|
||||||
|
risks associated with Your exercise of permissions under this License.
|
||||||
|
|
||||||
|
8. Limitation of Liability. In no event and under no legal theory,
|
||||||
|
whether in tort (including negligence), contract, or otherwise,
|
||||||
|
unless required by applicable law (such as deliberate and grossly
|
||||||
|
negligent acts) or agreed to in writing, shall any Contributor be
|
||||||
|
liable to You for damages, including any direct, indirect, special,
|
||||||
|
incidental, or consequential damages of any character arising as a
|
||||||
|
result of this License or out of the use or inability to use the
|
||||||
|
Work (including but not limited to damages for loss of goodwill,
|
||||||
|
work stoppage, computer failure or malfunction, or any and all
|
||||||
|
other commercial damages or losses), even if such Contributor
|
||||||
|
has been advised of the possibility of such damages.
|
||||||
|
|
||||||
|
9. Accepting Warranty or Additional Liability. While redistributing
|
||||||
|
the Work or Derivative Works thereof, You may choose to offer,
|
||||||
|
and charge a fee for, acceptance of support, warranty, indemnity,
|
||||||
|
or other liability obligations and/or rights consistent with this
|
||||||
|
License. However, in accepting such obligations, You may act only
|
||||||
|
on Your own behalf and on Your sole responsibility, not on behalf
|
||||||
|
of any other Contributor, and only if You agree to indemnify,
|
||||||
|
defend, and hold each Contributor harmless for any liability
|
||||||
|
incurred by, or claims asserted against, such Contributor by reason
|
||||||
|
of your accepting any such warranty or additional liability.
|
||||||
|
|
||||||
|
END OF TERMS AND CONDITIONS
|
||||||
|
|
||||||
|
APPENDIX: How to apply the Apache License to your work.
|
||||||
|
|
||||||
|
To apply the Apache License to your work, attach the following
|
||||||
|
boilerplate notice, with the fields enclosed by brackets "[]"
|
||||||
|
replaced with your own identifying information. (Don't include
|
||||||
|
the brackets!) The text should be enclosed in the appropriate
|
||||||
|
comment syntax for the file format. We also recommend that a
|
||||||
|
file or class name and description of purpose be included on the
|
||||||
|
same "printed page" as the copyright notice for easier
|
||||||
|
identification within third-party archives.
|
||||||
|
|
||||||
|
Copyright [yyyy] [name of copyright owner]
|
||||||
|
|
||||||
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
you may not use this file except in compliance with the License.
|
||||||
|
You may obtain a copy of the License at
|
||||||
|
|
||||||
|
http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
|
||||||
|
Unless required by applicable law or agreed to in writing, software
|
||||||
|
distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
See the License for the specific language governing permissions and
|
||||||
|
limitations under the License.
|
19
src/libraries/Licenses/MIT_License.txt
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
Copyright (c) 2013, 2014 EclipseSource
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
in the Software without restriction, including without limitation the rights
|
||||||
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
copies of the Software, and to permit persons to whom the Software is
|
||||||
|
furnished to do so, subject to the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included in all
|
||||||
|
copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||||
|
SOFTWARE.
|
BIN
src/libraries/commons-io-2.5.jar
Normal file
BIN
src/libraries/jfoenix-1.3.0.jar
Normal file
BIN
src/libraries/minimal-json-0.9.4.jar
Normal file
BIN
src/libraries/sqlite-jdbc-3.16.1.jar
Normal file
50
src/recources/HomeFlix-Local_de_DE.properties
Normal file
@ -0,0 +1,50 @@
|
|||||||
|
# HomeFlix-Local_de_DE.properties German Local
|
||||||
|
info = Info
|
||||||
|
settings = Einstellungen
|
||||||
|
streamingSettings = Stream Einst.
|
||||||
|
tfPath = Pfad...
|
||||||
|
tfSearch = Suche...
|
||||||
|
openFolder = Ordner \u00F6ffnen
|
||||||
|
chooseFolder = Ordner ausw\u00E4hlen
|
||||||
|
fontSize = Schriftgr\u00F6\u00DFe:
|
||||||
|
checkUpdates = Auf Update pr\u00FCfen
|
||||||
|
checkingUpdates = Es wird nach Updates gesucht...
|
||||||
|
updateBtnavail = Update verf\u00FCgbar
|
||||||
|
updateBtnNotavail = Kein Update verf\u00FCgbar
|
||||||
|
autoUpdate = beim Start nach Updates suchen:
|
||||||
|
version = Version:
|
||||||
|
columnName = Name
|
||||||
|
columnRating = Bewertung
|
||||||
|
columnStreamUrl = Datei Name
|
||||||
|
columnResolution = Aufl\u00F6sung
|
||||||
|
columnSeason = Staffel
|
||||||
|
columnYear = Jahr
|
||||||
|
errorUpdateV = Beim ausf\u00FChren des Updates ist ein Fehler aufgetreten! \nError: could not check update version (nvc)\nWeitere Hilfe erhalten sie unter www.kellerkinder.xyz \noder wenden sie sich an support@kellerkinder.xyz
|
||||||
|
errorUpdateD = Beim ausf\u00FChren des Updates ist ein Fehler aufgetreten! \nError: could not download update files (ndf)\nWeitere Hilfe erhalten sie unter www.kellerkinder.xyz \noder wenden sie sich an support@kellerkinder.xyz
|
||||||
|
errorPlay = Beim \u00F6ffnen der Datei ist ein Fehler aufgetreten! \nError: could not open file (nof) \nWeitere Hilfe erhalten sie unter www.kellerkinder.xyz \noder wenden sie sich an support@kellerkinder.xyz
|
||||||
|
errorMode = Oh, da lief etwas falsch! Da hat jemand einen falschen Modus verwendet. \nError: mode unknow (muk)\nWeitere Hilfe erhalten sie unter www.kellerkinder.xyz \noder wenden sie sich an support@kellerkinder.xyz
|
||||||
|
errorOpenStream = Beim \u00F6ffnen des Streams ist ein Fehler aufgetreten!
|
||||||
|
errorLoad = Beim laden der Einstellungen ist ein Fehler aufgetreten!
|
||||||
|
errorSave = Beim speichern der Einstellungen ist ein Fehler aufgetreten!
|
||||||
|
noFilmFound = Kein Film mit diesem Titel gefunden!
|
||||||
|
linuxBug = Zurzeit werden unter Linux leider keine Dateien mit Leerzeichen unterst\u00FCtzt!
|
||||||
|
vlcNotInstalled = Um einen Film abspielen wird der VLC Media Player ben\u00F6tigt!
|
||||||
|
infoText = \nMaintainer: seilo@kellerkinder.xyz und \nhendrik.schutter@coptersicht.de \n(c) 2016-2017 Kellerkinder www.kellerkinder.xyz
|
||||||
|
title = Titel
|
||||||
|
year = Jahr
|
||||||
|
rating = Einstufung
|
||||||
|
publishedOn = Ver\u00F6ffentlicht am
|
||||||
|
duration = Laufzeit
|
||||||
|
genre = Gener
|
||||||
|
director = Regisseur
|
||||||
|
writer = Autor
|
||||||
|
actors = Schauspieler
|
||||||
|
plot = Beschreibung
|
||||||
|
language = Original Sprache
|
||||||
|
country = Produktionsland
|
||||||
|
awards = Auszeichnungen
|
||||||
|
metascore = Metascore
|
||||||
|
imdbRating = IMDB-Bewertung
|
||||||
|
type = Type
|
||||||
|
firstStartHeader = Es ist kein Stammverzeichnis f\u00FCr Filme angegeben!
|
||||||
|
firstStartContent = Stammverzeichniss angeben?
|
50
src/recources/HomeFlix-Local_en_US.properties
Normal file
@ -0,0 +1,50 @@
|
|||||||
|
# HomeFlix-Local_en_US.properties US-English Local and default
|
||||||
|
info = Info
|
||||||
|
settings = Settings
|
||||||
|
streamingSettings = Stream Settings
|
||||||
|
tfPath = Path...
|
||||||
|
tfSearch = Search...
|
||||||
|
openFolder = open Folder
|
||||||
|
chooseFolder = choose Directory
|
||||||
|
fontSize = font size:
|
||||||
|
checkUpdates = check for updates
|
||||||
|
checkingUpdates = checking for updates...
|
||||||
|
updateBtnavail = update available
|
||||||
|
updateBtnNotavail = no update available
|
||||||
|
autoUpdate = check at startup for updates:
|
||||||
|
version = Version:
|
||||||
|
columnName = Name
|
||||||
|
columnRating = Rating
|
||||||
|
columnStreamUrl = File Name
|
||||||
|
columnResolution = Resolution
|
||||||
|
columnSeason = Season
|
||||||
|
columnYear = Year
|
||||||
|
errorUpdateV = An error has occurred during update! \nError: could not check update version (nvc) \nTo get help, visit www.kellerkinder.xyz \nor contcat support@kellerkinder.xyz
|
||||||
|
errorUpdateD = An error has occurred during update! \nError: could not download update files (ndf) \nTo get help, visit www.kellerkinder.xyz \nor contcat support@kellerkinder.xyz
|
||||||
|
errorPlay = An error has occurred during opening the file! \nError: could not open file (nof) \nTo get help, visit www.kellerkinder.xyz \nor contcat support@kellerkinder.xyz
|
||||||
|
errorMode = Oh, something went wrong! It seems someone has used a wrong mode. \nError: mode unknow (muk) \nTo get help, visit www.kellerkinder.xyz \nor contcat support@kellerkinder.xyz
|
||||||
|
errorOpenStream = An error has occurred during opening the stream!
|
||||||
|
errorLoad = An error occurred while loading the settings!
|
||||||
|
errorSave = An error occurred while saving the settings!
|
||||||
|
noFilmFound = No film with this title found!
|
||||||
|
linuxBug = Currently no files are supported with additional space under Linux unfortunately!
|
||||||
|
vlcNotInstalled = VLC Media Player is required to play a movie!
|
||||||
|
infoText = \nMaintainer: seilo@kellerkinder.xyz and \nhendrik.schutter@coptersicht.de \n(c) 2016-2017 Kellerkinder www.kellerkinder.xyz
|
||||||
|
title = Title
|
||||||
|
year = Year
|
||||||
|
rating = Rating
|
||||||
|
publishedOn = published on
|
||||||
|
duration = Duration
|
||||||
|
genre = Gener
|
||||||
|
director = Director
|
||||||
|
writer = Writer
|
||||||
|
actors = Actors
|
||||||
|
plot = Plot
|
||||||
|
language = Language
|
||||||
|
country = Country
|
||||||
|
awards = Awards
|
||||||
|
metascore = Metascore
|
||||||
|
imdbRating = IMDB-Rating
|
||||||
|
type = Type
|
||||||
|
firstStartHeader = There is no root directory for movies!
|
||||||
|
firstStartContent = Specify a root directory?
|
Before Width: | Height: | Size: 24 KiB After Width: | Height: | Size: 24 KiB |
Before Width: | Height: | Size: 30 KiB After Width: | Height: | Size: 30 KiB |
BIN
src/recources/icons/close_black_2048x2048.png
Normal file
After Width: | Height: | Size: 9.3 KiB |
BIN
src/recources/icons/ic_favorite_black_18dp_1x.png
Normal file
After Width: | Height: | Size: 214 B |
BIN
src/recources/icons/ic_favorite_border_black_18dp_1x.png
Normal file
After Width: | Height: | Size: 261 B |
BIN
src/recources/icons/ic_play_arrow_black_18dp_1x.png
Normal file
After Width: | Height: | Size: 131 B |
BIN
src/recources/icons/ic_play_arrow_white_18dp_1x.png
Normal file
After Width: | Height: | Size: 135 B |
BIN
src/recources/icons/ic_search_black_18dp_1x.png
Normal file
After Width: | Height: | Size: 215 B |
BIN
src/recources/icons/ic_skip_next_black_18dp_1x.png
Normal file
After Width: | Height: | Size: 128 B |
BIN
src/recources/icons/ic_skip_next_white_18dp_1x.png
Normal file
After Width: | Height: | Size: 134 B |
BIN
src/recources/icons/ic_skip_previous_black_18dp_1x.png
Normal file
After Width: | Height: | Size: 131 B |
BIN
src/recources/icons/ic_skip_previous_white_18dp_1x.png
Normal file
After Width: | Height: | Size: 138 B |
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 14 KiB |
Before Width: | Height: | Size: 15 KiB After Width: | Height: | Size: 15 KiB |
1
updates/buildNumber.txt
Normal file
@ -0,0 +1 @@
|
|||||||
|
125
|
@ -1 +1 @@
|
|||||||
0.3.5
|
0.4.0
|
||||||
|