From a216a7b455a0db20928fcd13169d564c5bbdd863 Mon Sep 17 00:00:00 2001 From: Louis Vallat Date: Tue, 17 Nov 2020 21:10:30 +0100 Subject: [PATCH] [FEATURE] Finalized possibility to reimport all subtitles from database and bumped version to 0.4-SNAPSHOT Signed-off-by: Louis Vallat --- src/main/java/xyz/vallat/louis/MoviesQuoteBot.java | 14 +------------- .../vallat/louis/database/SubtitleLineManager.java | 3 +-- 2 files changed, 2 insertions(+), 15 deletions(-) diff --git a/src/main/java/xyz/vallat/louis/MoviesQuoteBot.java b/src/main/java/xyz/vallat/louis/MoviesQuoteBot.java index c073cea..70d2036 100644 --- a/src/main/java/xyz/vallat/louis/MoviesQuoteBot.java +++ b/src/main/java/xyz/vallat/louis/MoviesQuoteBot.java @@ -1,11 +1,6 @@ package xyz.vallat.louis; -import com.github.wtekiela.opensub4j.response.ListResponse; -import com.github.wtekiela.opensub4j.response.ResponseStatus; -import com.github.wtekiela.opensub4j.response.SubtitleFile; -import com.github.wtekiela.opensub4j.response.SubtitleInfo; import org.apache.commons.cli.*; -import org.apache.xmlrpc.XmlRpcException; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import xyz.vallat.louis.codes.ExitCodes; @@ -13,29 +8,22 @@ import xyz.vallat.louis.database.DBManager; import xyz.vallat.louis.database.SubtitleLineManager; import xyz.vallat.louis.database.SubtitleManager; import xyz.vallat.louis.discord.DiscordManager; -import xyz.vallat.louis.omdb.objects.Movie; import xyz.vallat.louis.sockets.CommandsClient; import xyz.vallat.louis.sockets.CommandsServer; import xyz.vallat.louis.subtitles.OpenSubtitles; -import xyz.vallat.louis.subtitles.dao.Lang; import xyz.vallat.louis.subtitles.dao.Subtitle; -import xyz.vallat.louis.subtitles.dao.SubtitleBlock; -import xyz.vallat.louis.subtitles.parser.SubtitleParser; import java.io.File; import java.io.IOException; import java.nio.file.Files; import java.nio.file.Path; -import java.util.List; -import java.util.Optional; -import java.util.stream.Stream; public class MoviesQuoteBot { public static final String PREFIX = "!"; public static final String NAME = "Movies Quote Bot"; public static final String DESCRIPTION = "I may know quotes from movies."; - public static final String VERSION = "0.3.8-SNAPSHOT"; + public static final String VERSION = "0.4-SNAPSHOT"; public static final String KILL_SWITCH_FILE = "system_locked"; public static final String MAINTENANCE_MODE_FILE = "maintenance_mode_locked"; private static final Logger logger = LoggerFactory.getLogger(MoviesQuoteBot.class.getCanonicalName()); diff --git a/src/main/java/xyz/vallat/louis/database/SubtitleLineManager.java b/src/main/java/xyz/vallat/louis/database/SubtitleLineManager.java index 59312b0..045e025 100644 --- a/src/main/java/xyz/vallat/louis/database/SubtitleLineManager.java +++ b/src/main/java/xyz/vallat/louis/database/SubtitleLineManager.java @@ -17,7 +17,6 @@ import xyz.vallat.louis.subtitles.dao.Subtitle; import xyz.vallat.louis.subtitles.dao.SubtitleBlock; import xyz.vallat.louis.subtitles.parser.SubtitleParser; -import javax.swing.plaf.nimbus.State; import java.sql.Connection; import java.sql.PreparedStatement; import java.sql.SQLException; @@ -133,7 +132,7 @@ public final class SubtitleLineManager { logger.warn("Flushing subtitle lines."); try (Connection connection = DBManager.getConnection()) { String query = "TRUNCATE subtitle_lines RESTART IDENTITY;"; - try (Statement stmt = connection.createStatement()){ + try (Statement stmt = connection.createStatement()) { stmt.executeUpdate(query); } } catch (SQLException e) {