Added private constructor to FilmManager as it is a utility class

Signed-off-by: Louis Vallat <louis@louis-vallat.xyz>
This commit is contained in:
Louis Vallat 2020-10-28 14:27:13 +01:00
parent 0c335aa023
commit b781f735ca
2 changed files with 4 additions and 10 deletions

View File

@ -12,14 +12,9 @@ import org.slf4j.LoggerFactory;
import reactor.core.publisher.Mono; import reactor.core.publisher.Mono;
import xyz.vallat.louis.commands.*; import xyz.vallat.louis.commands.*;
import xyz.vallat.louis.database.DBManager; 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.env.EnvironmentVariables;
import xyz.vallat.louis.omdb.OMDBClient;
import xyz.vallat.louis.subtitles.OpenSubtitles; import xyz.vallat.louis.subtitles.OpenSubtitles;
import java.io.IOException;
import java.text.ParseException;
import java.util.HashMap; import java.util.HashMap;
import java.util.Map; import java.util.Map;
@ -41,9 +36,7 @@ public class MovieQuoteBot {
commands.put("download", new Download(PREFIX + "download")); commands.put("download", new Download(PREFIX + "download"));
} }
public static void main(String[] args) throws InterruptedException, ParseException, IOException, ImportationException { public static void main(String[] args) {
FilmManager.importFilm(OMDBClient.getMovie("Surrogates", false));
/*
DBManager.testConnection(); DBManager.testConnection();
DBManager.initDatabase(); DBManager.initDatabase();
OpenSubtitles.login(); OpenSubtitles.login();
@ -57,8 +50,6 @@ public class MovieQuoteBot {
})); }));
discordClient.onDisconnect().block(); discordClient.onDisconnect().block();
*/
} }
private static void registerDiscordCommands() { private static void registerDiscordCommands() {

View File

@ -13,6 +13,9 @@ public final class FilmManager {
private static final Logger logger = LoggerFactory.getLogger(FilmManager.class.getCanonicalName()); private static final Logger logger = LoggerFactory.getLogger(FilmManager.class.getCanonicalName());
private FilmManager() {
}
static void initializeFilm(Connection connection) throws SQLException { static void initializeFilm(Connection connection) throws SQLException {
logger.debug("Creating film table."); logger.debug("Creating film table.");
try (Statement stmt = connection.createStatement()) { try (Statement stmt = connection.createStatement()) {