[FEATURE] Finalized possibility to reimport all subtitles from database and bumped version to 0.4-SNAPSHOT

Signed-off-by: Louis Vallat <louis@louis-vallat.xyz>
This commit is contained in:
Louis Vallat 2020-11-17 21:10:30 +01:00
parent 5446e6af38
commit a216a7b455
2 changed files with 2 additions and 15 deletions

View File

@ -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());

View File

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