Compare commits
133 Commits
Author | SHA1 | Date |
---|---|---|
|
9b5fdaa418 | 4 months ago |
|
d167b60661 | 4 months ago |
|
ce49804c87 | 5 months ago |
|
e6f19f5f29 | 8 months ago |
|
af615f11b8 | 8 months ago |
|
4e0e1c4666 | 1 year ago |
|
f4c3b0a6f8 | 2 years ago |
|
c323ac957c | 2 years ago |
|
5c4b78436f | 2 years ago |
|
257b09fc9c | 2 years ago |
|
e29bcc5da3 | 2 years ago |
|
fb390e3169 | 2 years ago |
|
d210655dcf | 2 years ago |
|
834bffda93 | 2 years ago |
|
c04a7c0d4d | 2 years ago |
|
5e0fd8063d | 2 years ago |
|
0d57127d64 | 2 years ago |
|
965c081d05 | 2 years ago |
|
c6b2d1a9d8 | 2 years ago |
|
a8160ce65e | 2 years ago |
|
4184e982ea | 2 years ago |
|
ef5d87c54c | 2 years ago |
|
5db24f16f2 | 2 years ago |
|
03c69b232a | 3 years ago |
|
e4cc195fa8 | 3 years ago |
|
5e71bb95f0 | 3 years ago |
|
a1936c138f | 3 years ago |
|
000b5e12c2 | 3 years ago |
|
ae20909012 | 3 years ago |
|
75a80535a7 | 3 years ago |
|
d8062513e9 | 3 years ago |
|
9f8a7c0f4c | 3 years ago |
|
5488bece2d | 3 years ago |
|
9af3ad26bd | 3 years ago |
|
989281ff8d | 3 years ago |
|
e84e7f9d20 | 3 years ago |
|
c38be08905 | 3 years ago |
|
512b715c1a | 3 years ago |
|
693650fece | 3 years ago |
|
656c22d48a | 3 years ago |
|
2bbbfff532 | 3 years ago |
|
f23e6c77ea | 3 years ago |
|
bb8bcd460a | 3 years ago |
|
4d503546ff | 3 years ago |
|
4ff8b7819f | 3 years ago |
|
7dbe0d46d8 | 3 years ago |
|
ea9e740552 | 3 years ago |
|
fdb39ea2f5 | 3 years ago |
|
46cd28a642 | 3 years ago |
|
3381047e76 | 3 years ago |
|
0786770e97 | 3 years ago |
|
e47f3ea2f7 | 3 years ago |
|
c735583a04 | 3 years ago |
|
5600456556 | 3 years ago |
|
cc05600e0a | 3 years ago |
|
291f183f5e | 3 years ago |
|
a80e077d47 | 3 years ago |
|
3e80354d88 | 3 years ago |
|
d3d22db7a8 | 3 years ago |
|
060527ae03 | 3 years ago |
|
2daeb86d67 | 3 years ago |
|
29c6b30168 | 3 years ago |
|
1d06aaeaa2 | 4 years ago |
|
a677abc15c | 4 years ago |
|
c3a148b267 | 4 years ago |
|
6585908717 | 4 years ago |
|
201109e79d | 4 years ago |
|
f1ccb04f9e | 4 years ago |
|
9f8c19ab8e | 4 years ago |
|
079f15cd59 | 4 years ago |
|
0d9ffb36e5 | 4 years ago |
|
5e89faff49 | 4 years ago |
|
fed25f2fce | 4 years ago |
|
0cf02c52a6 | 4 years ago |
|
b8a67fbc27 | 4 years ago |
|
5a3b647060 | 4 years ago |
|
ffe068e1b0 | 4 years ago |
|
4d31e53a7c | 4 years ago |
|
2e86836041 | 4 years ago |
|
a23b87fcb8 | 4 years ago |
|
a1319382ff | 4 years ago |
|
a491937b30 | 4 years ago |
|
e6ce1dc464 | 4 years ago |
|
abbb272bff | 4 years ago |
|
96bfc461cb | 4 years ago |
|
32fc533c00 | 4 years ago |
|
76bb0fa8b1 | 4 years ago |
|
8f6832c147 | 4 years ago |
|
fe1dc01605 | 4 years ago |
|
814bb00158 | 4 years ago |
|
f68b0c0feb | 4 years ago |
|
d16e724cce | 4 years ago |
|
23ac33ca9b | 4 years ago |
|
67142662d8 | 4 years ago |
|
b603051c59 | 4 years ago |
|
3b188904f6 | 4 years ago |
|
50ae1747e6 | 4 years ago |
|
b1f9a6c505 | 4 years ago |
|
4b1b20f814 | 4 years ago |
|
95d29d772c | 4 years ago |
|
3840e31849 | 4 years ago |
|
031046643c | 4 years ago |
|
1fca1c551d | 4 years ago |
|
036ed8ad11 | 4 years ago |
|
26f26ec9f8 | 4 years ago |
|
e1ec3cae7e | 4 years ago |
|
311577fe7c | 4 years ago |
|
9577508311 | 4 years ago |
|
d7ed7c7b21 | 4 years ago |
|
1e0ab2b943 | 4 years ago |
|
46efa77fce | 4 years ago |
|
402a004ef6 | 4 years ago |
|
48b9c99baa | 4 years ago |
|
74e8783082 | 4 years ago |
|
391ef59f70 | 4 years ago |
|
85a403a834 | 4 years ago |
|
46c1c43cab | 4 years ago |
|
d7e9ce56c1 | 4 years ago |
|
d70ad34df4 | 4 years ago |
|
d609715771 | 4 years ago |
|
53f68c9a69 | 4 years ago |
|
535efd98ee | 4 years ago |
|
9a4eae0be9 | 4 years ago |
|
23e46b7913 | 4 years ago |
|
d3ea1b1956 | 4 years ago |
|
1299748bed | 4 years ago |
|
865e732445 | 5 years ago |
|
4ca4f7ad3a | 5 years ago |
|
85d65b6235 | 5 years ago |
|
08048d57ac | 5 years ago |
|
6baa47b852 | 5 years ago |
|
944151d35f | 5 years ago |
|
b331ffd270 | 5 years ago |
79 changed files with 5740 additions and 3410 deletions
@ -1,32 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?> |
||||
<classpath> |
||||
<classpathentry kind="src" output="target/classes" path="src/main/java"> |
||||
<attributes> |
||||
<attribute name="optional" value="true"/> |
||||
<attribute name="maven.pomderived" value="true"/> |
||||
</attributes> |
||||
</classpathentry> |
||||
<classpathentry kind="src" output="target/test-classes" path="src/test/java"> |
||||
<attributes> |
||||
<attribute name="optional" value="true"/> |
||||
<attribute name="maven.pomderived" value="true"/> |
||||
</attributes> |
||||
</classpathentry> |
||||
<classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources"> |
||||
<attributes> |
||||
<attribute name="maven.pomderived" value="true"/> |
||||
</attributes> |
||||
</classpathentry> |
||||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-9"> |
||||
<attributes> |
||||
<attribute name="module" value="true"/> |
||||
<attribute name="maven.pomderived" value="true"/> |
||||
</attributes> |
||||
</classpathentry> |
||||
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER"> |
||||
<attributes> |
||||
<attribute name="maven.pomderived" value="true"/> |
||||
</attributes> |
||||
</classpathentry> |
||||
<classpathentry kind="output" path="target/classes"/> |
||||
</classpath> |
@ -1,23 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?> |
||||
<projectDescription> |
||||
<name>Project-HomeFlix</name> |
||||
<comment></comment> |
||||
<projects> |
||||
</projects> |
||||
<buildSpec> |
||||
<buildCommand> |
||||
<name>org.eclipse.jdt.core.javabuilder</name> |
||||
<arguments> |
||||
</arguments> |
||||
</buildCommand> |
||||
<buildCommand> |
||||
<name>org.eclipse.m2e.core.maven2Builder</name> |
||||
<arguments> |
||||
</arguments> |
||||
</buildCommand> |
||||
</buildSpec> |
||||
<natures> |
||||
<nature>org.eclipse.jdt.core.javanature</nature> |
||||
<nature>org.eclipse.m2e.core.maven2Nature</nature> |
||||
</natures> |
||||
</projectDescription> |
@ -1,5 +0,0 @@
|
||||
eclipse.preferences.version=1 |
||||
encoding//src/main/java=UTF-8 |
||||
encoding//src/main/resources=UTF-8 |
||||
encoding//src/test/java=UTF-8 |
||||
encoding/<project>=UTF-8 |
@ -1,13 +0,0 @@
|
||||
eclipse.preferences.version=1 |
||||
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled |
||||
org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate |
||||
org.eclipse.jdt.core.compiler.codegen.targetPlatform=9 |
||||
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve |
||||
org.eclipse.jdt.core.compiler.compliance=9 |
||||
org.eclipse.jdt.core.compiler.debug.lineNumber=generate |
||||
org.eclipse.jdt.core.compiler.debug.localVariable=generate |
||||
org.eclipse.jdt.core.compiler.debug.sourceFile=generate |
||||
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error |
||||
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error |
||||
org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning |
||||
org.eclipse.jdt.core.compiler.source=9 |
@ -1,4 +0,0 @@
|
||||
activeProfiles= |
||||
eclipse.preferences.version=1 |
||||
resolveWorkspaceProjects=true |
||||
version=1 |
@ -0,0 +1,5 @@
|
||||
pipeline: |
||||
package: |
||||
image: maven |
||||
commands: |
||||
- mvn clean package |
@ -1,24 +1,19 @@
|
||||
 |
||||
[](https://github.com/Seil0/Project-HomeFlix/releases) |
||||
[](https://www.gnu.org/licenses/gpl-3.0) |
||||
[](https://ci.mosad.xyz/Seil0/Project-HomeFlix) [](https://git.mosad.xyz/Seil0/Project-HomeFlix/releases) |
||||
[](https://git.mosad.xyz/Seil0/Project-HomeFlix/releases) |
||||
[](https://www.gnu.org/licenses/gpl-3.0) |
||||
|
||||
# Project-HomeFlix |
||||
Project-HomeFlix is a Kellerkinder Project, that alowes you to sort all your local saved movies in clean UI. Project-HomeFlix is free and open-source software and uses other open-source projects to provied a nice user experience. |
||||
|
||||
## Installation |
||||
Simply download the Project-HomeFlix.jar from [releases](https://github.com/Seil0/Project-HomeFlix/releases), make sure you have the latest version of java 8 oracle jre/jdk installed, open the .jar file. If you need additional information pleas visit our [wiki](https://github.com/Seil0/Project-HomeFlix/wiki). |
||||
Simply download the Project-HomeFlix.jar from [releases](https://git.mosad.xyz/Seil0/Project-HomeFlix/releases), make sure you have the latest version of java 8 oracle jre/jdk installed, open the .jar file. If you need additional information pleas visit our [wiki](https://git.mosad.xyz/Seil0/Project-HomeFlix/wiki). |
||||
|
||||
## Development information |
||||
The dev branch is **only merged** into master when a **new release** is released, so **master contains the latest released version**. Please commit all changes to [dev](https://github.com/Seil0/Project-HomeFlix/tree/dev). |
||||
The dev branch is **only merged** into master when a **new release** is released, so **master contains the latest released version**. Please commit all changes to [dev](https://git.mosad.xyz/Seil0/Project-HomeFlix/src/branch/dev). |
||||
|
||||
Librarys used in this Project: |
||||
JFoenix: https://github.com/jfoenixadmin/JFoenix |
||||
minimal-json: https://github.com/ralfstx/minimal-json |
||||
sqlite-jdbc: https://github.com/xerial/sqlite-jdbc |
||||
apache commons io : https://commons.apache.org/proper/commons-io/ |
||||
[Libraries used in this Project](https://git.mosad.xyz/Seil0/Project-HomeFlix/wiki/Documentation#used-libraries-and-apis) |
||||
|
||||
## screenshots |
||||
 |
||||
## Screenshots |
||||
 |
||||
|
||||
Project-HomeFlix © 2016-2018 Kellerkinder ([Seil0](https://github.com/Seil0), [Windoofs](https://github.com/Windoofs)) |
||||
www.kellerkinder.xyz |
||||
Project-HomeFlix © 2016-2019 mosad www.mosad.xyz, Project by [@Seil0](https://git.mosad.xyz/Seil0) and [@localhorst](https://git.mosad.xyz/localhorst) |
||||
|
@ -1,103 +1,148 @@
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> |
||||
<modelVersion>4.0.0</modelVersion> |
||||
|
||||
<groupId>org.kellerkinder</groupId> |
||||
<artifactId>Project-HomeFlix</artifactId> |
||||
<version>0.6.99</version> |
||||
<packaging>jar</packaging> |
||||
|
||||
<name>Project-HomeFlix</name> |
||||
<url>http://www.kellerkinder.xyz</url> |
||||
|
||||
<properties> |
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> |
||||
</properties> |
||||
|
||||
<dependencies> |
||||
|
||||
<dependency> |
||||
<groupId>junit</groupId> |
||||
<artifactId>junit</artifactId> |
||||
<version>4.12</version> |
||||
<scope>test</scope> |
||||
</dependency> |
||||
|
||||
<dependency> |
||||
<groupId>commons-io</groupId> |
||||
<artifactId>commons-io</artifactId> |
||||
<version>2.6</version> |
||||
</dependency> |
||||
|
||||
<dependency> |
||||
<groupId>com.jfoenix</groupId> |
||||
<artifactId>jfoenix</artifactId> |
||||
<version>9.0.3</version> |
||||
</dependency> |
||||
|
||||
<dependency> |
||||
<groupId>com.eclipsesource.minimal-json</groupId> |
||||
<artifactId>minimal-json</artifactId> |
||||
<version>0.9.5</version> |
||||
</dependency> |
||||
|
||||
<dependency> |
||||
<groupId>org.xerial</groupId> |
||||
<artifactId>sqlite-jdbc</artifactId> |
||||
<version>3.21.0.1</version> |
||||
</dependency> |
||||
|
||||
<dependency> |
||||
<groupId>org.apache.logging.log4j</groupId> |
||||
<artifactId>log4j-api</artifactId> |
||||
<version>2.11.0</version> |
||||
</dependency> |
||||
|
||||
<dependency> |
||||
<groupId>org.apache.logging.log4j</groupId> |
||||
<artifactId>log4j-core</artifactId> |
||||
<version>2.11.0</version> |
||||
</dependency> |
||||
</dependencies> |
||||
|
||||
<build> |
||||
<plugins> |
||||
|
||||
<plugin> |
||||
<groupId>org.apache.maven.plugins</groupId> |
||||
<artifactId>maven-compiler-plugin</artifactId> |
||||
<version>3.7.0</version> |
||||
<configuration> |
||||
<source>9</source> |
||||
<target>9</target> |
||||
<showWarnings>true</showWarnings> |
||||
<showDeprecation>true</showDeprecation> |
||||
</configuration> |
||||
</plugin> |
||||
|
||||
<plugin> |
||||
<groupId>org.apache.maven.plugins</groupId> |
||||
<artifactId>maven-shade-plugin</artifactId> |
||||
<version>3.1.1</version> |
||||
<configuration> |
||||
<shadedArtifactAttached>true</shadedArtifactAttached> |
||||
<transformers> |
||||
<transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer"> |
||||
<mainClass>kellerkinder.HomeFlix.application.Main</mainClass> |
||||
</transformer> |
||||
</transformers> |
||||
</configuration> |
||||
<executions> |
||||
<execution> |
||||
<phase>package</phase> |
||||
<goals> |
||||
<goal>shade</goal> |
||||
</goals> |
||||
</execution> |
||||
</executions> |
||||
</plugin> |
||||
|
||||
</plugins> |
||||
</build> |
||||
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" |
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> |
||||
<modelVersion>4.0.0</modelVersion> |
||||
|
||||
<groupId>org.mosad</groupId> |
||||
<artifactId>Project-HomeFlix</artifactId> |
||||
<version>0.8.0</version> |
||||
<packaging>jar</packaging> |
||||
|
||||
<name>Project-HomeFlix</name> |
||||
<url>https://www.mosad.xyz</url> |
||||
|
||||
<properties> |
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> |
||||
<javafx.version>16</javafx.version> |
||||
</properties> |
||||
|
||||
<dependencies> |
||||
|
||||
<dependency> |
||||
<groupId>junit</groupId> |
||||
<artifactId>junit</artifactId> |
||||
<version>4.13.2</version> |
||||
<scope>test</scope> |
||||
</dependency> |
||||
|
||||
<dependency> |
||||
<groupId>org.openjfx</groupId> |
||||
<artifactId>javafx-controls</artifactId> |
||||
<version>${javafx.version}</version> |
||||
</dependency> |
||||
|
||||
<dependency> |
||||
<groupId>org.openjfx</groupId> |
||||
<artifactId>javafx-fxml</artifactId> |
||||
<version>${javafx.version}</version> |
||||
</dependency> |
||||
|
||||
<dependency> |
||||
<groupId>org.openjfx</groupId> |
||||
<artifactId>javafx-media</artifactId> |
||||
<version>${javafx.version}</version> |
||||
</dependency> |
||||
|
||||
<dependency> |
||||
<groupId>uk.co.caprica</groupId> |
||||
<artifactId>vlcj</artifactId> |
||||
<version>4.5.2</version> |
||||
</dependency> |
||||
|
||||
<dependency> |
||||
<groupId>commons-io</groupId> |
||||
<artifactId>commons-io</artifactId> |
||||
<version>2.11.0</version> |
||||
</dependency> |
||||
|
||||
<dependency> |
||||
<groupId>com.jfoenix</groupId> |
||||
<artifactId>jfoenix</artifactId> |
||||
<version>9.0.10</version> |
||||
</dependency> |
||||
|
||||
<dependency> |
||||
<groupId>com.eclipsesource.minimal-json</groupId> |
||||
<artifactId>minimal-json</artifactId> |
||||
<version>0.9.5</version> |
||||
</dependency> |
||||
|
||||
<dependency> |
||||
<groupId>org.xerial</groupId> |
||||
<artifactId>sqlite-jdbc</artifactId> |
||||
<version>3.36.0.3</version> |
||||
</dependency> |
||||
|
||||
<dependency> |
||||
<groupId>org.apache.logging.log4j</groupId> |
||||
<artifactId>log4j-api</artifactId> |
||||
<version>2.17.1</version> |
||||
</dependency> |
||||
|
||||
<dependency> |
||||
<groupId>org.apache.logging.log4j</groupId> |
||||
<artifactId>log4j-core</artifactId> |
||||
<version>2.17.1</version> |
||||
</dependency> |
||||
</dependencies> |
||||
|
||||
<build> |
||||
<plugins> |
||||
|
||||
<plugin> |
||||
<groupId>org.apache.maven.plugins</groupId> |
||||
<artifactId>maven-compiler-plugin</artifactId> |
||||
<version>3.8.1</version> |
||||
<configuration> |
||||
<source>11</source> |
||||
<target>11</target> |
||||
<!--<release>11</release> --> |
||||
<showWarnings>true</showWarnings> |
||||
<showDeprecation>true</showDeprecation> |
||||
</configuration> |
||||
</plugin> |
||||
|
||||
<plugin> |
||||
<groupId>org.codehaus.mojo</groupId> |
||||
<artifactId>exec-maven-plugin</artifactId> |
||||
<version>3.0.0</version> |
||||
<executions> |
||||
<execution> |
||||
<goals> |
||||
<goal>java</goal> |
||||
</goals> |
||||
</execution> |
||||
</executions> |
||||
<configuration> |
||||
<mainClass>org.mosad.homeflix.application.Main</mainClass> |
||||
</configuration> |
||||
</plugin> |
||||
|
||||
<plugin> |
||||
<groupId>org.apache.maven.plugins</groupId> |
||||
<artifactId>maven-shade-plugin</artifactId> |
||||
<version>3.2.2</version> |
||||
<configuration> |
||||
<finalName>Project-HomeFlix</finalName> |
||||
<shadedArtifactAttached>true</shadedArtifactAttached> |
||||
<transformers> |
||||
<transformer |
||||
implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer"> |
||||
<mainClass>org.mosad.homeflix.application.JavaFX11Main</mainClass> |
||||
</transformer> |
||||
</transformers> |
||||
</configuration> |
||||
<executions> |
||||
<execution> |
||||
<phase>package</phase> |
||||
<goals> |
||||
<goal>shade</goal> |
||||
</goals> |
||||
</execution> |
||||
</executions> |
||||
</plugin> |
||||
|
||||
</plugins> |
||||
</build> |
||||
|
||||
</project> |
||||
|
@ -1,240 +0,0 @@
|
||||
/** |
||||
* Project-HomeFlix |
||||
* |
||||
* Copyright 2016-2018 <@Seil0> |
||||
* |
||||
* 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 |
||||
* the Free Software Foundation; either version 3 of the License, or |
||||
* (at your option) any later version. |
||||
* |
||||
* This program is distributed in the hope that it will be useful, |
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
* GNU General Public License for more details. |
||||
* |
||||
* You should have received a copy of the GNU General Public License |
||||
* along with this program; if not, write to the Free Software |
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, |
||||
* MA 02110-1301, USA. |
||||
* |
||||
*/ |
||||
package kellerkinder.HomeFlix.application; |
||||
|
||||
import java.io.File; |
||||
import java.io.IOException; |
||||
import java.util.Locale; |
||||
import java.util.ResourceBundle; |
||||
|
||||
import org.apache.logging.log4j.LogManager; |
||||
import org.apache.logging.log4j.Logger; |
||||
import org.kellerkinder.Alerts.JFX2BtnCancelAlert; |
||||
|
||||
import javafx.application.Application; |
||||
import javafx.event.ActionEvent; |
||||
import javafx.event.EventHandler; |
||||
import javafx.fxml.FXMLLoader; |
||||
import javafx.scene.Scene; |
||||
import javafx.scene.image.Image; |
||||
import javafx.scene.layout.AnchorPane; |
||||
import javafx.stage.DirectoryChooser; |
||||
import javafx.stage.FileChooser; |
||||
import javafx.stage.Stage; |
||||
import javafx.stage.WindowEvent; |
||||
|
||||
public class Main extends Application { |
||||
|
||||
private Stage primaryStage; |
||||
private Scene scene; |
||||
private AnchorPane pane; |
||||
private MainWindowController mainWindowController; |
||||
private static String userHome = System.getProperty("user.home"); |
||||
private static String userName = System.getProperty("user.name"); |
||||
private static String osName = System.getProperty("os.name"); |
||||
private static String osArch = System.getProperty("os.arch"); |
||||
private static String osVers = System.getProperty("os.version"); |
||||
private static String javaVers = System.getProperty("java.version"); |
||||
private static String javaVend = System.getProperty("java.vendor"); |
||||
private static String local = System.getProperty("user.language") + "_" + System.getProperty("user.country"); |
||||
private String dirWin = userHome + "/Documents/HomeFlix"; // Windows: C:/Users/"User"/Documents/HomeFlix
|
||||
private String dirLinux = userHome + "/HomeFlix"; // Linux: /home/"User"/HomeFlix
|
||||
private File directory; |
||||
private File configFile; |
||||
private File posterCache; |
||||
private ResourceBundle bundle; |
||||
private static Logger LOGGER; |
||||
|
||||
@Override |
||||
public void start(Stage primaryStage) throws IOException { |
||||
LOGGER.info("OS: " + osName + " " + osVers + " " + osArch); |
||||
LOGGER.info("Java: " + javaVend + " " + javaVers); |
||||
LOGGER.info("User: " + userName + " " + userHome); |
||||
|
||||
this.primaryStage = primaryStage; |
||||
mainWindow(); |
||||
} |
||||
|
||||
/** |
||||
* initialize the mainWindowController, GUI and load the saved settings or call addFirstSource |
||||
* initialize the primaryStage and set the file/directory paths |
||||
*/ |
||||
private void mainWindow(){ |
||||
try { |
||||
FXMLLoader loader = new FXMLLoader(); |
||||
loader.setLocation(ClassLoader.getSystemResource("fxml/MainWindow.fxml")); |
||||
pane = (AnchorPane) loader.load(); |
||||
primaryStage.setMinHeight(600.00); |
||||
primaryStage.setMinWidth(1000.00); |
||||
primaryStage.setResizable(false); |
||||
primaryStage.setTitle("Project HomeFlix"); |
||||
primaryStage.getIcons().add(new Image(Main.class.getResourceAsStream("/icons/Homeflix_Icon_64x64.png"))); //adds application icon
|
||||
primaryStage.setOnCloseRequest(new EventHandler<WindowEvent>() { |
||||
public void handle(WindowEvent we) { |
||||
System.exit(1); |
||||
} |
||||
}); |
||||
|
||||
mainWindowController = loader.getController(); //Link of FXMLController and controller class
|
||||
mainWindowController.setMain(this); //call setMain
|
||||
|
||||
|
||||
// get OS and the specific paths
|
||||
if (osName.contains("Windows")) { |
||||
directory = new File(dirWin); |
||||
configFile = new File(dirWin + "/config.xml"); |
||||
posterCache = new File(dirWin + "/posterCache"); |
||||
} else { |
||||
directory = new File(dirLinux); |
||||
configFile = new File(dirLinux + "/config.xml"); |
||||
posterCache = new File(dirLinux + "/posterCache"); |
||||
} |
||||
|
||||
// generate window
|
||||
scene = new Scene(pane); // create new scene, append pane to scene
|
||||
scene.getStylesheets().add(getClass().getResource("/css/MainWindow.css").toExternalForm()); |
||||
primaryStage.setScene(scene); // append scene to stage
|
||||
primaryStage.show(); // show stage
|
||||
|
||||
// startup checks
|
||||
if (!configFile.exists()) { |
||||
directory.mkdir(); |
||||
addFirstSource(); |
||||
mainWindowController.setColor("ee3523"); |
||||
mainWindowController.setFontSize(17.0); |
||||
mainWindowController.setAutoUpdate(false); |
||||
mainWindowController.setLocal(local); |
||||
mainWindowController.saveSettings(); |
||||
} |
||||
|
||||
if (!posterCache.exists()) { |
||||
posterCache.mkdir(); |
||||
} |
||||
|
||||
// init here as it loads the games to the mwc and the gui, therefore the window must exist
|
||||
mainWindowController.init(); |
||||
mainWindowController.getDbController().init(); |
||||
} catch (IOException e) { |
||||
LOGGER.error(e); |
||||
} |
||||
} |
||||
|
||||
/** |
||||
* we need to get the path for the first source from the user and add it to |
||||
* sources.json, if the user ends the file-/directory-chooser the program will exit |
||||
*/ |
||||
private void addFirstSource() { |
||||
switch (local) { |
||||
case "en_US": |
||||
bundle = ResourceBundle.getBundle("locals.HomeFlix-Local", Locale.US); // us_english
|
||||
break; |
||||
case "de_DE": |
||||
bundle = ResourceBundle.getBundle("locals.HomeFlix-Local", Locale.GERMAN); // German
|
||||
break; |
||||
default: |
||||
bundle = ResourceBundle.getBundle("locals.HomeFlix-Local", Locale.US); // default local
|
||||
break; |
||||
} |
||||
|
||||
JFX2BtnCancelAlert selectFirstSource = new JFX2BtnCancelAlert(bundle.getString("addSourceHeader"), |
||||
bundle.getString("addSourceBody"), |
||||
"-fx-button-type: RAISED; -fx-background-color: #ee3523; -fx-text-fill: BLACK;", |
||||
bundle.getString("addDirectory"), bundle.getString("addStreamSource"), |
||||
bundle.getString("cancelBtnText"), primaryStage); |
||||
|
||||
// directory action
|
||||
EventHandler<ActionEvent> btn1Action = new EventHandler<ActionEvent>() { |
||||
@Override |
||||
public void handle(ActionEvent event) { |
||||
DirectoryChooser directoryChooser = new DirectoryChooser(); |
||||
directoryChooser.setTitle(bundle.getString("addDirectory")); |
||||
File selectedFolder = directoryChooser.showDialog(primaryStage); |
||||
if (selectedFolder != null && selectedFolder.exists()) { |
||||
mainWindowController.addSource(selectedFolder.getPath(), "local"); |
||||
selectFirstSource.getAlert().close(); |
||||
} else { |
||||
LOGGER.error("The selected folder dosen't exist!"); |
||||
System.exit(1); |
||||
} |
||||
} |
||||
}; |
||||
|
||||
// streaming action
|
||||
EventHandler<ActionEvent> btn2Action = new EventHandler<ActionEvent>() { |
||||
@Override |
||||
public void handle(ActionEvent event) { |
||||
FileChooser fileChooser = new FileChooser(); |
||||
fileChooser.setTitle("addStreamSource"); |
||||
File selectedFile = fileChooser.showOpenDialog(getPrimaryStage()); |
||||
if (selectedFile != null && selectedFile.exists()) { |
||||
mainWindowController.addSource(selectedFile.getPath(), "stream"); |
||||
selectFirstSource.getAlert().close(); |
||||
} else { |
||||
LOGGER.error("The selected file dosen't exist!"); |
||||
System.exit(1); |
||||
} |
||||
} |
||||
}; |
||||
selectFirstSource.setBtn1Action(btn1Action); |
||||
selectFirstSource.setBtn2Action(btn2Action); |
||||
selectFirstSource.showAndWait(); |
||||
} |
||||
|
||||
/** |
||||
* set the log file location and initialize the logger |
||||
* launch the GUI |
||||
* @param args arguments given at the start |
||||
*/ |
||||
public static void main(String[] args) { |
||||
if (System.getProperty("os.name").equals("Windows")) { |
||||
System.setProperty("logFilename", userHome + "/Documents/HomeFlix/app.log"); |
||||
File logFile = new File(userHome + "/Documents/HomeFlix/app.log"); |
||||
logFile.delete(); |
||||
} else { |
||||
System.setProperty("logFilename", userHome + "/HomeFlix/app.log"); |
||||
File logFile = new File(userHome + "/HomeFlix/app.log"); |
||||
logFile.delete(); |
||||
} |
||||
LOGGER = LogManager.getLogger(Main.class.getName()); |
||||
launch(args); |
||||
} |
||||
|
||||
public Stage getPrimaryStage() { |
||||
return primaryStage; |
||||
} |
||||
|
||||
public AnchorPane getPane() { |
||||
return pane; |
||||
} |
||||
|
||||
public File getDirectory() { |
||||
return directory; |
||||
} |
||||
|
||||
public File getConfigFile() { |
||||
return configFile; |
||||
} |
||||
|
||||
public File getPosterCache() { |
||||
return posterCache; |
||||
} |
||||
} |
File diff suppressed because it is too large
Load Diff
@ -1,778 +0,0 @@
|
||||
/** |
||||
* Project-HomeFlix |
||||
* |
||||
* Copyright 2016-2018 <@Seil0> |
||||
* |
||||
* 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 |
||||
* the Free Software Foundation; either version 3 of the License, or |
||||
* (at your option) any later version. |
||||
* |
||||
* This program is distributed in the hope that it will be useful, |
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
* GNU General Public License for more details. |
||||
* |
||||
* You should have received a copy of the GNU General Public License |
||||
* along with this program; if not, write to the Free Software |
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, |
||||
* MA 02110-1301, USA. |
||||
*/ |
||||
package kellerkinder.HomeFlix.controller; |
||||
|
||||
import java.io.File; |
||||
import java.io.FileNotFoundException; |
||||
import java.io.FileReader; |
||||
import java.io.IOException; |
||||
import java.net.URLConnection; |
||||
import java.sql.Connection; |
||||
import java.sql.DriverManager; |
||||
import java.sql.PreparedStatement; |
||||
import java.sql.ResultSet; |
||||
import java.sql.SQLException; |
||||
import java.sql.Statement; |
||||
import java.util.ArrayList; |
||||
import java.util.List; |
||||
|
||||
import org.apache.logging.log4j.LogManager; |
||||
import org.apache.logging.log4j.Logger; |
||||
|
||||
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; |
||||
import kellerkinder.HomeFlix.application.Main; |
||||
import kellerkinder.HomeFlix.application.MainWindowController; |
||||
import kellerkinder.HomeFlix.datatypes.SourceDataType; |
||||
import kellerkinder.HomeFlix.datatypes.FilmTabelDataType; |
||||
|
||||
public class DBController { |
||||
|
||||
private MainWindowController mainWindowController; |
||||
private Main main; |
||||
private String DB_PATH = System.getProperty("user.home") + "\\Documents\\HomeFlix" + "\\" + "Homeflix.db"; //path to database file
|
||||
private Image favorite_black = new Image("icons/ic_favorite_black_18dp_1x.png"); |
||||
private Image favorite_border_black = new Image("icons/ic_favorite_border_black_18dp_1x.png"); |
||||
private List<String> filmsdbAll = new ArrayList<String>(); |
||||
private List<String> filmsdbDir = new ArrayList<String>(); |
||||
private List<String> filmsdbStreamURL = new ArrayList<String>(); // needed
|
||||
private List<String> filmsStreamURL = new ArrayList<String>(); // needed
|
||||
private Connection connection = null; |
||||
private static final Logger LOGGER = LogManager.getLogger(DBController.class.getName()); |
||||
|
||||
/** |
||||
* constructor for DBController |
||||
* @param main the main object |
||||
* @param mainWindowController the mainWindowController object |
||||
*/ |
||||
public DBController(Main main, MainWindowController mainWindowController) { |
||||
this.main = main; |
||||
this.mainWindowController = mainWindowController; |
||||
} |
||||
|
||||
/** |
||||
* initialize the {@link DBController} |
||||
* initialize the database connection |
||||
* check if there is a need to create a new database |
||||
* refresh the database |
||||
*/ |
||||
public void init() { |
||||
LOGGER.info("<========== starting loading sql ==========>"); |
||||
initDatabaseConnection(); |
||||
createDatabase(); |
||||
refreshDataBase(); |
||||
LOGGER.info("<========== finished loading sql ==========>"); |
||||
} |
||||
|
||||
/** |
||||
* create a new connection to the HomeFlix.db database |
||||
* AutoCommit is set to false to prevent some issues, so manual commit is active! |
||||
*/ |
||||
private void initDatabaseConnection() { |
||||
DB_PATH = main.getDirectory() + "/Homeflix.db"; |
||||
try { |
||||
// create a database connection
|
||||
connection = DriverManager.getConnection("jdbc:sqlite:" + DB_PATH); |
||||
connection.setAutoCommit(false); |
||||
} catch (SQLException e) { |
||||
// if the error message is "out of memory", it probably means no database file is found
|
||||
LOGGER.error("error while loading the ROM database", e); |
||||
} |
||||
LOGGER.info("ROM database loaded successfull"); |
||||
} |
||||
|
||||
/** |
||||
* if tables don't exist create them |
||||
* films table: streamUrl is primary key |
||||
* cache table: streamUrl is primary key |
||||
*/ |
||||
private void createDatabase() { |
||||
try { |
||||
Statement stmt = connection.createStatement(); |
||||
stmt.executeUpdate("create table if not exists films (streamUrl, title, season, episode, favorite, cached, currentTime)"); |
||||
stmt.executeUpdate("create table if not exists cache (" |
||||
+ "streamUrl, Title, Year, Rated, Released, Runtime, Genre, Director, Writer," |
||||
+ " Actors, Plot, Language, Country, Awards, Metascore, imdbRating, imdbVotes," |
||||
+ " imdbID, Type, Poster, Response)"); |
||||
stmt.close(); |
||||
} catch (SQLException e) { |
||||
LOGGER.error(e); |
||||
} |
||||
} |
||||
|
||||
/** |
||||
* get all database entries |
||||
*/ |
||||
private void loadDatabase() { |
||||
// get all entries from the table
|
||||
try { |
||||
Statement stmt = connection.createStatement(); |
||||
ResultSet rs = stmt.executeQuery("SELECT * FROM films"); |
||||
while (rs.next()) { |
||||
filmsdbDir.add(rs.getString("title")); |
||||
filmsdbStreamURL.add(rs.getString("streamUrl")); |
||||
} |
||||
stmt.close(); |
||||
rs.close(); |
||||
} catch (SQLException e) { |
||||
LOGGER.error("Ups! an error occured!", e); |
||||
} |
||||
|
||||
// add all entries to filmsAll and filmsdbAl, for later comparing
|
||||
filmsdbAll.addAll(filmsdbDir); |
||||
LOGGER.info("films in directory: " + filmsStreamURL.size()); |
||||
LOGGER.info("filme in db: " + filmsdbStreamURL.size()); |
||||
} |
||||
|
||||
/** |
||||
* load sources from sources.json |
||||
* if mode == local, get all files and series-folder from the directory |
||||
* else mode must be streaming, read all entries from the streaming file |
||||
*/ |
||||
private void loadSources() { |
||||
// remove sources from table
|
||||
mainWindowController.getSourcesList().removeAll(mainWindowController.getSourcesList()); |
||||
mainWindowController.getSourceRoot().getChildren().removeAll(mainWindowController.getSourceRoot().getChildren()); |
||||
|
||||
try { |
||||
JsonArray sources = Json.parse(new FileReader(main.getDirectory() + "/sources.json")).asArray(); |
||||
for (JsonValue source : sources) { |
||||
String path = source.asObject().getString("path", ""); |
||||
String mode = source.asObject().getString("mode", ""); |
||||
mainWindowController.addSourceToTable(path, mode); // add source to source-table
|
||||
if (mode.equals("local")) { |
||||
for (File file : new File(path).listFiles()) { |
||||
if (file.isFile() && isVideoFile(file.getPath())) { |
||||
filmsStreamURL.add(file.getPath()); |
||||
} else if(file.isDirectory()) { |
||||
// get all folders (series)
|
||||
for (File season : file.listFiles()) { |
||||
if (season.isDirectory()) { |
||||
for (File episode : season.listFiles()) { |
||||
if (!filmsdbStreamURL.contains(episode.getPath())) { |
||||
filmsStreamURL.add(episode.getPath()); |
||||
} |
||||
} |
||||
} |
||||
} |
||||
} |
||||
} |
||||
LOGGER.info("added files from: " + path); |
||||
} else { |
||||
// getting all entries from the streaming lists
|
||||
try { |
||||
JsonObject object = Json.parse(new FileReader(path)).asObject(); |
||||
JsonArray items = object.get("entries").asArray(); |
||||
for (JsonValue item : items) { |
||||
filmsStreamURL.add(item.asObject().getString("streamUrl", "")); |
||||
} |
||||
LOGGER.info("added films from: " + path); |
||||
} catch (IOException e) { |
||||
LOGGER.error(e); |
||||
} |
||||
} |
||||
} |
||||
} catch (Exception e) { |
||||
e.printStackTrace(); |
||||
} |
||||
} |
||||
|
||||
/** |
||||
* load the data to the mainWindowController |
||||
* order entries by title |
||||
*/ |
||||
private void loadDataToMWC() { |
||||
LOGGER.info("loading data to mwc ..."); |
||||
try { |
||||
//load local Data
|
||||
Statement stmt = connection.createStatement(); |
||||
ResultSet rs = stmt.executeQuery("SELECT * FROM films ORDER BY title"); |
||||
while (rs.next()) { |
||||
// System.out.println(rs.getString("title") + "Season:" + rs.getString("season") + ":");
|
||||
if (rs.getBoolean("favorite") == true) { |
||||
mainWindowController.getFilmsList().add(new FilmTabelDataType(rs.getString("streamUrl"), |
||||
rs.getString("title"), rs.getString("season"), rs.getString("episode") ,rs.getBoolean("favorite"), |
||||
rs.getBoolean("cached"), new ImageView(favorite_black))); |
||||
} else { |
||||
mainWindowController.getFilmsList().add(new FilmTabelDataType(rs.getString("streamUrl"), |
||||
rs.getString("title"), rs.getString("season"), rs.getString("episode"), rs.getBoolean("favorite"), |
||||
rs.getBoolean("cached"), new ImageView(favorite_border_black))); |
||||
} |
||||
} |
||||
stmt.close(); |
||||
rs.close(); |
||||
} catch (SQLException e) { |
||||
LOGGER.error("Ups! an error occured!", e); |
||||
} |
||||
|
||||
LOGGER.info("loading data to the GUI ..."); |
||||
mainWindowController.addDataUI(mainWindowController.getFilmsList()); |
||||
} |
||||
|
||||
/** |
||||
* refresh data in mainWindowController for one element |
||||
* @param streamUrl of the film |
||||
* @param index of the film in LocalFilms list |
||||
*/ |
||||
public void refresh(String streamUrl, int indexList) { |
||||
LOGGER.info("refresh ..."); |
||||
try { |
||||
Statement stmt = connection.createStatement(); |
||||
ResultSet rs = stmt.executeQuery("SELECT * FROM films WHERE streamUrl = \"" + streamUrl + "\";"); |
||||
|
||||
while (rs.next()) { |
||||
if (rs.getBoolean("favorite") == true) { |
||||
mainWindowController.getFilmsList().set(indexList, new FilmTabelDataType(rs.getString("streamUrl"), |
||||
rs.getString("title"), rs.getString("season"), rs.getString("episode"), rs.getBoolean("favorite"), |
||||
rs.getBoolean("cached"), new ImageView(favorite_black))); |
||||
} else { |
||||
mainWindowController.getFilmsList().set(indexList, new FilmTabelDataType(rs.getString("streamUrl"), |
||||
rs.getString("title"), rs.getString("season"), rs.getString("episode"), rs.getBoolean("favorite"), |
||||
rs.getBoolean("cached"), new ImageView(favorite_border_black))); |
||||
} |
||||
} |
||||
rs.close(); |
||||
stmt.close(); |
||||
} catch (Exception e) { |
||||
LOGGER.error("Ups! error while refreshing mwc!", e); |
||||
} |
||||
} |
||||
|
||||
/** |
||||
* refresh database to contain all (new added) entries |
||||
* refresh the MainWindowController content, |
||||
* to contain all (new added) entries from the database |
||||
*/ |
||||
public void refreshDataBase() { |
||||
LOGGER.info("refreshing the Database ..."); |
||||
|
||||
// clean all ArraLists
|
||||
filmsdbAll.clear(); |
||||
filmsdbDir.clear(); |
||||
filmsdbStreamURL.clear(); |
||||
filmsStreamURL.clear(); |
||||
|
||||
loadSources(); // reload all sources
|
||||
loadDatabase(); // reload all films saved in the DB
|
||||
|
||||
try { |
||||
checkAddEntry(); |
||||
checkRemoveEntry(); |
||||
} catch (Exception e) { |
||||
LOGGER.error("Error while refreshing |