diff --git a/src/main/java/xyz/vallat/louis/MovieQuoteBot.java b/src/main/java/xyz/vallat/louis/MovieQuoteBot.java index 2411749..875c778 100644 --- a/src/main/java/xyz/vallat/louis/MovieQuoteBot.java +++ b/src/main/java/xyz/vallat/louis/MovieQuoteBot.java @@ -12,8 +12,10 @@ import org.slf4j.LoggerFactory; import reactor.core.publisher.Mono; import xyz.vallat.louis.commands.*; import xyz.vallat.louis.database.DBManager; +import xyz.vallat.louis.database.FilmManager; import xyz.vallat.louis.database.exceptions.ImportationException; import xyz.vallat.louis.env.EnvironmentVariables; +import xyz.vallat.louis.omdb.OMDBClient; import xyz.vallat.louis.subtitles.OpenSubtitles; import java.io.IOException; @@ -39,7 +41,9 @@ public class MovieQuoteBot { commands.put("download", new Download(PREFIX + "download")); } - public static void main(String[] args) { + public static void main(String[] args) throws InterruptedException, ParseException, IOException, ImportationException { + FilmManager.importFilm(OMDBClient.getMovie("Surrogates", false)); + /* DBManager.testConnection(); DBManager.initDatabase(); OpenSubtitles.login(); @@ -53,6 +57,8 @@ public class MovieQuoteBot { })); discordClient.onDisconnect().block(); + + */ } private static void registerDiscordCommands() { diff --git a/src/main/java/xyz/vallat/louis/database/FilmManager.java b/src/main/java/xyz/vallat/louis/database/FilmManager.java index 3dc66d1..7f5ed03 100644 --- a/src/main/java/xyz/vallat/louis/database/FilmManager.java +++ b/src/main/java/xyz/vallat/louis/database/FilmManager.java @@ -38,7 +38,7 @@ public final class FilmManager { try (PreparedStatement stmt = connection.prepareStatement(insert)) { stmt.setString(1, movie.getImdbID()); stmt.setString(2, movie.getTitle()); - stmt.setDate(3, Date.valueOf(movie.getReleased().atZone(ZoneId.of("UTC")).toLocalDate())); + stmt.setDate(3, Date.valueOf(movie.getReleased().atZone(ZoneId.systemDefault()).toLocalDate())); stmt.setString(4, movie.getType()); stmt.setString(5, movie.getPoster()); stmt.executeUpdate();