Compare commits

..

133 Commits
151 ... dev

Author SHA1 Message Date
Jannik 9b5fdaa418
fix typo in SeriesDVEpisode class name 5 months ago
Jannik d167b60661
add subtitle support to player; update log4j to version 2.17.1 5 months ago
Jannik ce49804c87
update dependencies 6 months ago
Jannik e6f19f5f29 „README.md“ ändern 9 months ago
Jannik af615f11b8
update ci to woodpecker 9 months ago
Jannik 4e0e1c4666 „README.md“ ändern 2 years ago
Jannik f4c3b0a6f8
update the controls only when they are visible 2 years ago
Jannik c323ac957c
add button hover effect to player gui 2 years ago
Jannik 5c4b78436f
add linear-gradient to top & bottom bar, support start in fullscreen 2 years ago
Jannik 257b09fc9c
add correct audio popup style 2 years ago
Jannik e29bcc5da3
fix player resolution mismatch 2 years ago
Jannik fb390e3169
fix SeriesDetailView, improved the timesliders animated thumb 2 years ago
Jannik d210655dcf
add audio track selection popup, slider displays time as h:mm:ss now 2 years ago
Jannik 834bffda93
clean up DetailViews 2 years ago
Jannik c04a7c0d4d
add demo audio track selection popup 2 years ago
Jannik 5e0fd8063d
use try with resourcess 2 years ago
Jannik 0d57127d64
added replay and forward 10 sec button 2 years ago
Jannik 965c081d05
replace stop button with back button, show media title 2 years ago
Jannik c6b2d1a9d8
add player end time lable 2 years ago
Jannik a8160ce65e
new media player based on vlcj [Part 2] 2 years ago
Jannik 4184e982ea
new media player based on vlcj [Part 1] 2 years ago
Jannik ef5d87c54c
updated some libraries 2 years ago
Jannik 5db24f16f2 Update 'README.md' 3 years ago
Jannik 03c69b232a
some minor cleanup 3 years ago
Jannik e4cc195fa8
minor code cleanup 3 years ago
Jannik 5e71bb95f0
updated some libraries 3 years ago
Jannik a1936c138f Update 'README.md' 3 years ago
Jannik 000b5e12c2
added drone ci 3 years ago
Jannik ae20909012
update version to 0.8.0 3 years ago
Jannik 75a80535a7
reworked the UpdateController 3 years ago
Jannik d8062513e9
fixed animation coordinates for 9f8a7c0f4c 3 years ago
Jannik 9f8a7c0f4c
fixed scrollpane jumping to the top after returning from detailview 3 years ago
Jannik 5488bece2d
minor bugfixes and clean up 3 years ago
Jannik 9af3ad26bd
implemented settings as nested conroller 3 years ago
Jannik 989281ff8d
added SettingsView 3 years ago
Jannik e84e7f9d20
removed all table-mode stuff, minor ui tweaks 3 years ago
Jannik c38be08905
some css style improvements 3 years ago
Jannik 512b715c1a
first working version of the PosterMode, enabled by default 3 years ago
Jannik 693650fece
added first layout for SeriesDetailView 3 years ago
Jannik 656c22d48a
added FilmDetailView 3 years ago
Jannik 2bbbfff532
more FilmDeatilView work 3 years ago
Jannik f23e6c77ea
added a sample nested controller 3 years ago
Jannik bb8bcd460a
PosterMode now has posters, UI optimizations 3 years ago
Jannik 4d503546ff
bug fixes 3 years ago
Jannik 4ff8b7819f
Use a FlowPane fot the PosterMode 3 years ago
Jannik 7dbe0d46d8
some clean up and first bits for poster mode GUI logic 3 years ago
Jannik ea9e740552
minor clean up 3 years ago
Jannik fdb39ea2f5
fixed missing elements when searching 3 years ago
Jannik 46cd28a642 updated to javafx 12 3 years ago
Jannik 3381047e76 updated javafx to 11.0.2 3 years ago
Jannik 0786770e97 added a comment 3 years ago
Jannik e47f3ea2f7 minor bug fixes 3 years ago
Jannik c735583a04 cache is now date based, minor clean up 3 years ago
Jannik 5600456556 fixed open folder btn when using Linux, more clean up 4 years ago
Jannik cc05600e0a removed all mwc usage in DBController 4 years ago
Jannik 291f183f5e removed more mwc dependencies & code clean up 4 years ago
Jannik a80e077d47 code clean up and removed some unneeded mwc uses in DBController 4 years ago
Jannik 3e80354d88 don't use mains primarystage, disabled column resizeing 4 years ago
Jannik d3d22db7a8 moved static vars and save & load code to XMLController 4 years ago
Jannik 060527ae03 removed travis.yml 4 years ago
Jannik 2daeb86d67 updated readme 4 years ago
Jannik 29c6b30168 small omdbAPI query fixes 4 years ago
Jannik 1d06aaeaa2 clean up 4 years ago
Jannik a677abc15c added a "next episode" button to the player 4 years ago
Jannik c3a148b267 reworked the DBController 4 years ago
Jannik 6585908717 minor gui fixes 4 years ago
Jannik 201109e79d updated jfoenix 9.0.6 -> 9.0.8 4 years ago
Jannik f1ccb04f9e „README.md“ ändern 4 years ago
Jannik 9f8c19ab8e fixed issue #6 4 years ago
Jannik 079f15cd59 player fixes & lib updates 4 years ago
Jannik 0d9ffb36e5 Merge remote-tracking branch 'origin/dev' into dev 4 years ago
Jannik 5e89faff49 use gitea instead of github 4 years ago
Jannik fed25f2fce „README.md“ ändern 4 years ago
Jannik 0cf02c52a6 updated gitignore 4 years ago
Jannik b8a67fbc27 removed eclipse specific files 4 years ago
Jannik 5a3b647060 „.project“ löschen 4 years ago
Jannik ffe068e1b0 „.classpath“ löschen 4 years ago
Jannik 4d31e53a7c updated gitignore to ignore eclipse files 4 years ago
Jannik 2e86836041 small code cleanup 4 years ago
Jannik a23b87fcb8 fixed first startup issue 4 years ago
Jannik a1319382ff removed the usage of mwc in omdbAPIQuery 4 years ago
Jannik a491937b30 Merge branch 'java11' of Seil0/Project-HomeFlix into dev 4 years ago
Jannik e6ce1dc464 fixed javafx11 executable jar 4 years ago
Jannik abbb272bff fixed java11 execution 4 years ago
Jannik 96bfc461cb formation fixes 4 years ago
Jannik 32fc533c00 fixed junit 4 years ago
Jannik 76bb0fa8b1 prepare java11 4 years ago
Jannik 8f6832c147 updated some libraries 4 years ago
Jannik fe1dc01605 code cleanup 4 years ago
Jannik 814bb00158 added getAllNotCachedEntries() 4 years ago
Jannik f68b0c0feb code clean up 4 years ago
Jannik d16e724cce documentation improvements 4 years ago
Jannik 23ac33ca9b 'README.md' ändern 4 years ago
Jannik 67142662d8 'README.md' ändern 4 years ago
Jannik b603051c59 typo 4 years ago
Jannik 3b188904f6 nothing to see here 4 years ago
Jannik 50ae1747e6 update sqlite-jdbc 3.21.0.1 -> 3.23.1 4 years ago
Jannik b1f9a6c505 java 9/10 4 years ago
Jannik 4b1b20f814 build against java 9/10/11 4 years ago
Jannik 95d29d772c try openjdk build too 4 years ago
Jannik 3840e31849 try to build with java 10 again 4 years ago
Jannik 031046643c save&load are now in the main class 4 years ago
Jannik 1fca1c551d more code cleanup 4 years ago
Jannik 036ed8ad11 DBController cleanup 4 years ago
Jannik 26f26ec9f8 target java 9 until travis offers jdk10 4 years ago
Jannik e1ec3cae7e travis oraclejdk9 & openjdk8 4 years ago
Jannik 311577fe7c openjdk9 4 years ago
Jannik 9577508311 openjdk10 4 years ago
Jannik d7ed7c7b21 target java 10 4 years ago
Jannik 1e0ab2b943 code cleanup 4 years ago
Jannik 46efa77fce omdb fixes 4 years ago
Jannik 402a004ef6 jfoenix 9.0.3 -> 9.0.4 4 years ago
Jannik 48b9c99baa more TODO 4 years ago
Jannik 74e8783082 HomeFLix now shows the plot for each episode of a series 4 years ago
Jannik 391ef59f70 code cleanup 4 years ago
Jannik 85a403a834 fixed Hamburger icon has wrong color after color change 4 years ago
Jannik 46c1c43cab
Update README.md 4 years ago
Jannik d7e9ce56c1 Merge remote-tracking branch 'origin/dev' into dev 4 years ago
Jannik d70ad34df4 added travis 4 years ago
Jannik d609715771
Merge pull request #25 from Seil0/master 4 years ago
Jannik 53f68c9a69
Merge pull request #24 from Seil0/dev 4 years ago
Jannik 535efd98ee release 0.7.0 4 years ago
Jannik 9a4eae0be9 autoplay fixes 4 years ago
Jannik 23e46b7913 cleanup 4 years ago
Jannik d3ea1b1956 fixed api arror if title dosent exist at omdbAPI 4 years ago
Jannik 1299748bed
Merge pull request #22 from Seil0/dev 4 years ago
Jannik 865e732445 Merge pull request #16 from Seil0/dev 5 years ago
Jannik 4ca4f7ad3a Merge pull request #13 from Seil0/dev 5 years ago
Jannik 85d65b6235 Merge pull request #12 from Seil0/dev 5 years ago
Jannik 08048d57ac Merge pull request #11 from Seil0/dev 5 years ago
Jannik 6baa47b852 Merge pull request #10 from Seil0/dev 5 years ago
Jannik 944151d35f Merge pull request #8 from Seil0/dev 5 years ago
Jannik b331ffd270 Merge pull request #7 from Seil0/dev 5 years ago
  1. 32
      .classpath
  2. 4
      .gitignore
  3. 23
      .project
  4. 5
      .settings/org.eclipse.core.resources.prefs
  5. 13
      .settings/org.eclipse.jdt.core.prefs
  6. 4
      .settings/org.eclipse.m2e.core.prefs
  7. 5
      .woodpecker.yml
  8. 23
      README.md
  9. 249
      pom.xml
  10. 240
      src/main/java/kellerkinder/HomeFlix/application/Main.java
  11. 1134
      src/main/java/kellerkinder/HomeFlix/application/MainWindowController.java
  12. 778
      src/main/java/kellerkinder/HomeFlix/controller/DBController.java
  13. 125
      src/main/java/kellerkinder/HomeFlix/controller/OMDbAPIController.java
  14. 162
      src/main/java/kellerkinder/HomeFlix/controller/UpdateController.java
  15. 147
      src/main/java/kellerkinder/HomeFlix/datatypes/FilmTabelDataType.java
  16. 86
      src/main/java/kellerkinder/HomeFlix/player/Player.java
  17. 276
      src/main/java/kellerkinder/HomeFlix/player/PlayerController.java
  18. 23
      src/main/java/org/kellerkinder/Alerts/JFX2BtnCancelAlert.java
  19. 11
      src/main/java/org/kellerkinder/Alerts/JFXInfoAlert.java
  20. 8
      src/main/java/org/mosad/homeflix/application/JavaFX11Main.java
  21. 124
      src/main/java/org/mosad/homeflix/application/Main.java
  22. 443
      src/main/java/org/mosad/homeflix/application/MainWindowController.java
  23. 316
      src/main/java/org/mosad/homeflix/application/SettingsView.java
  24. 42
      src/main/java/org/mosad/homeflix/application/view/DetailView.java
  25. 190
      src/main/java/org/mosad/homeflix/application/view/FilmDetailView.java
  26. 212
      src/main/java/org/mosad/homeflix/application/view/SeriesDetailView.java
  27. 794
      src/main/java/org/mosad/homeflix/controller/DBController.java
  28. 223
      src/main/java/org/mosad/homeflix/controller/OMDbAPIController.java
  29. 178
      src/main/java/org/mosad/homeflix/controller/SourcesController.java
  30. 131
      src/main/java/org/mosad/homeflix/controller/UpdateController.java
  31. 315
      src/main/java/org/mosad/homeflix/controller/XMLController.java
  32. 95
      src/main/java/org/mosad/homeflix/datatypes/DatabaseDataType.java
  33. 75
      src/main/java/org/mosad/homeflix/datatypes/FilmTabelDataType.java
  34. 268
      src/main/java/org/mosad/homeflix/datatypes/OMDbAPIResponseDataType.java
  35. 107
      src/main/java/org/mosad/homeflix/datatypes/PosterModeElement.java
  36. 68
      src/main/java/org/mosad/homeflix/datatypes/SeriesDVEpisode.java
  37. 4
      src/main/java/org/mosad/homeflix/datatypes/SourceDataType.java
  38. 172
      src/main/java/org/mosad/homeflix/player/HFMediaPlayerEventListener.java
  39. 165
      src/main/java/org/mosad/homeflix/player/Player.java
  40. 635
      src/main/java/org/mosad/homeflix/player/PlayerController.java
  41. 122
      src/main/resources/css/MainWindow.css
  42. 92
      src/main/resources/css/Player.css
  43. 216
      src/main/resources/fxml/FilmDetailView.fxml
  44. 178
      src/main/resources/fxml/MainWindow.fxml
  45. 165
      src/main/resources/fxml/PlayerWindow.fxml
  46. 167
      src/main/resources/fxml/SeriesDetailView.fxml
  47. 159
      src/main/resources/fxml/SettingsView.fxml
  48. BIN
      src/main/resources/icons/baseline_favorite_black_48dp.png
  49. BIN
      src/main/resources/icons/baseline_favorite_border_black_48dp.png
  50. BIN
      src/main/resources/icons/baseline_folder_black_48dp.png
  51. BIN
      src/main/resources/icons/baseline_forward_10_white_48dp.png
  52. BIN
      src/main/resources/icons/baseline_fullscreen_exit_white_48dp.png
  53. BIN
      src/main/resources/icons/baseline_fullscreen_white_48dp.png
  54. BIN
      src/main/resources/icons/baseline_keyboard_arrow_down_black_48dp.png
  55. BIN
      src/main/resources/icons/baseline_keyboard_arrow_down_white_48dp.png
  56. BIN
      src/main/resources/icons/baseline_keyboard_arrow_down_white_48dp_48x16.png
  57. BIN
      src/main/resources/icons/baseline_keyboard_backspace_white_48dp.png
  58. BIN
      src/main/resources/icons/baseline_list_black_48dp.png
  59. BIN
      src/main/resources/icons/baseline_pause_white_48dp.png
  60. BIN
      src/main/resources/icons/baseline_play_arrow_black_48dp.png
  61. BIN
      src/main/resources/icons/baseline_play_arrow_white_48dp.png
  62. BIN
      src/main/resources/icons/baseline_replay_10_white_48dp.png
  63. BIN
      src/main/resources/icons/baseline_subtitles_white_48dp.png
  64. BIN
      src/main/resources/icons/ic_favorite_black_18dp_1x.png
  65. BIN
      src/main/resources/icons/ic_favorite_border_black_18dp_1x.png
  66. BIN
      src/main/resources/icons/ic_fullscreen_black_24dp_1x.png
  67. BIN
      src/main/resources/icons/ic_fullscreen_exit_black_24dp_1x.png
  68. BIN
      src/main/resources/icons/ic_pause_black_24dp_1x.png
  69. BIN
      src/main/resources/icons/ic_play_arrow_black_18dp_1x.png
  70. BIN
      src/main/resources/icons/ic_play_arrow_black_24dp_1x.png
  71. BIN
      src/main/resources/icons/ic_play_arrow_white_18dp_1x.png
  72. BIN
      src/main/resources/icons/ic_search_black_18dp_1x.png
  73. BIN
      src/main/resources/icons/ic_skip_next_black_18dp_1x.png
  74. BIN
      src/main/resources/icons/ic_skip_next_white_18dp_1x.png
  75. BIN
      src/main/resources/icons/ic_skip_previous_black_18dp_1x.png
  76. BIN
      src/main/resources/icons/ic_skip_previous_white_18dp_1x.png
  77. BIN
      src/main/resources/icons/ic_stop_black_24dp_1x.png
  78. 73
      src/main/resources/locals/HomeFlix-Local_de_DE.properties
  79. 73
      src/main/resources/locals/HomeFlix-Local_en_US.properties

32
.classpath

@ -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>

4
.gitignore vendored

@ -49,4 +49,6 @@ config.xml
.directory
target/
apiKeys.json
.classpath
.project
.settings/*

23
.project

@ -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>

5
.settings/org.eclipse.core.resources.prefs

@ -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

13
.settings/org.eclipse.jdt.core.prefs

@ -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

4
.settings/org.eclipse.m2e.core.prefs

@ -1,4 +0,0 @@
activeProfiles=
eclipse.preferences.version=1
resolveWorkspaceProjects=true
version=1

5
.woodpecker.yml

@ -0,0 +1,5 @@
pipeline:
package:
image: maven
commands:
- mvn clean package

23
README.md

@ -1,24 +1,19 @@
![Total Downloads](https://img.shields.io/github/downloads/Seil0/Project-HomeFlix/total.svg?style=flat-square)
[![Latest](https://img.shields.io/github/release/Seil0/Project-HomeFlix/all.svg?style=flat-square)](https://github.com/Seil0/Project-HomeFlix/releases)
[![License: GPL v3](https://img.shields.io/badge/License-GPL%20v3-blue.svg?style=flat-square)](https://www.gnu.org/licenses/gpl-3.0)
[![Build Status](https://ci.mosad.xyz/api/badges/Seil0/Project-HomeFlix/status.svg)](https://ci.mosad.xyz/Seil0/Project-HomeFlix) [![Latest](https://img.shields.io/badge/Download-latest-brightgreen.svg)](https://git.mosad.xyz/Seil0/Project-HomeFlix/releases)
[![Release](https://img.shields.io/badge/dynamic/json.svg?label=release&url=https://git.mosad.xyz/api/v1/repos/Seil0/Project-HomeFlix/releases&query=$[0].tag_name)](https://git.mosad.xyz/Seil0/Project-HomeFlix/releases)
[![License: GPL v3](https://img.shields.io/badge/License-GPL%20v3-blue.svg)](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
![Screenshot](https://github.com/Seil0/Seil0.github.io/blob/master/images/Project-HomeFlix_MainWindow.png)
## Screenshots
![Screenshot](https://raw.githubusercontent.com/Seil0/Seil0.github.io/master/images/Project-HomeFlix_MainWindow.webp)
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)

249
pom.xml

@ -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>

240
src/main/java/kellerkinder/HomeFlix/application/Main.java

@ -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;
}
}

1134
src/main/java/kellerkinder/HomeFlix/application/MainWindowController.java

File diff suppressed because it is too large Load Diff

778
src/main/java/kellerkinder/HomeFlix/controller/DBController.java

@ -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 the database",