jfoenix 9.0.3 -> 9.0.4

This commit is contained in:
Jannik 2018-05-04 18:53:51 +02:00
parent 48b9c99baa
commit 402a004ef6
3 changed files with 10 additions and 4 deletions

View File

@ -32,7 +32,7 @@
<dependency>
<groupId>com.jfoenix</groupId>
<artifactId>jfoenix</artifactId>
<version>9.0.3</version>
<version>9.0.4</version>
</dependency>
<dependency>

View File

@ -615,8 +615,8 @@ public class DBController {
try {
mainWindowController.getPosterImageView().setImage(new Image(new File(rs.getString("Poster")).toURI().toString()));
} catch (Exception e) {
mainWindowController.getPosterImageView().setImage(new Image("resources/icons/close_black_2048x2048.png"));
LOGGER.error(e);
mainWindowController.getPosterImageView().setImage(new Image("icons/close_black_2048x2048.png"));
LOGGER.error("No Poster found, useing default.");
}
stmt.close();

View File

@ -110,7 +110,7 @@ public class OMDbAPIController implements Runnable {
try {
BufferedImage originalImage = ImageIO.read(new URL(object.getString("Poster", "")));
// change path to where file is located
omdbResponse.setPoster(main.getPosterCache() + "/" + mainWindowController.getCurrentTitle() + ".png");
omdbResponse.setPoster(main.getPosterCache() + "/" + omdbResponse.getTitle() + ".png");
ImageIO.write(originalImage, "png", new File(omdbResponse.getPoster()));
LOGGER.info("adding poster to cache: " + omdbResponse.getPoster());
} catch (Exception e) {
@ -146,6 +146,7 @@ public class OMDbAPIController implements Runnable {
BufferedReader ina = new BufferedReader(new InputStreamReader(apiUrl.openStream()));
output = ina.readLine();
ina.close();
System.out.println(apiUrl.toString());
LOGGER.info("response from '" + URL + "&t=" + title + "' was:" + output);
} catch (IOException e) {
LOGGER.error("error while making api request or reading response");
@ -156,6 +157,11 @@ public class OMDbAPIController implements Runnable {
return Json.parse(output).asObject();
}
/** TODO if responser == false & isSereis, query without series
* search for a movie/series title
* @param title the movie/series title
* @return the correct title if found
*/
private String searchByTitle(String title) {
String output = null;
// if the movie was not found try to search it