fix: various fixes for what is written to the import dialog.

This commit is contained in:
lantzelot-swe 2021-04-13 22:07:35 +02:00
parent 3f64e53a59
commit b6babab332
7 changed files with 15 additions and 14 deletions

View File

@ -478,14 +478,6 @@ public class DbConnector
{
String[] splittedRowValue = rowValue.split(COMMA);
String title = splittedRowValue[0];
if (addedRowsList.contains(rowValue.substring(0, rowValue.indexOf(",")).toLowerCase()))
{
//Add game, another one has been added with the same title, no one was available in the db at that point.
infoBuilder.append("Not available, adding to db\n");
logger.debug("Game: {} is not available, adding to db", title);
newRowValues.add(rowValue);
continue;
}
StringBuilder sqlBuilder = new StringBuilder();
sqlBuilder.append("SELECT COUNT(*) FROM gameinfo WHERE title = ");
sqlBuilder.append(title);
@ -496,6 +488,15 @@ public class DbConnector
infoBuilder.append(": ");
logger.debug("Checking game: {}", sql);
if (addedRowsList.contains(rowValue.substring(0, rowValue.indexOf(",")).toLowerCase()))
{
//Add game, another one has been added with the same title, no one was available in the db at that point.
infoBuilder.append("Not available, adding to db\n");
logger.debug("Game: {} is not available, adding to db", title);
newRowValues.add(rowValue);
continue;
}
//Check db
try (Connection conn = this.connect(); PreparedStatement pstmt = conn.prepareStatement(sql))
{
ResultSet rs = pstmt.executeQuery();

View File

@ -98,7 +98,7 @@ public class BackupProgressPanel extends JPanel
int count = text.length() - text.replace("ERROR:", "").length();
if (count > 0)
{
getTextArea().append("\nBackup ended with " + count/6 + " errors. See log file for details.");
getTextArea().append("\nBackup ended with " + count/6 + " errors. See pcusb.log for details.");
}
else
{

View File

@ -98,7 +98,7 @@ public class RestoreProgressPanel extends JPanel
int count = text.length() - text.replace("ERROR:", "").length();
if (count > 0)
{
getTextArea().append("\nRestore ended with " + count/6 + " errors. See log file for details.");
getTextArea().append("\nRestore ended with " + count/6 + " errors. See pcusb.log for details.");
}
else
{

View File

@ -98,7 +98,7 @@ public class ExportProgressPanel extends JPanel
int count = text.length() - text.replace("ERROR:", "").length();
if (count > 0)
{
getTextArea().append("\nExport ended with " + count/6 + " errors. See log file for details.");
getTextArea().append("\nExport ended with " + count/6 + " errors. See pcusb.log for details.");
}
else
{

View File

@ -29,7 +29,7 @@ public class CarouselImportWorker extends AbstractImportWorker
publish("Importing to db...");
List<List<String>> dbRowReadChunks = importManager.getDbRowReadChunks();
progressValueString = "Importing to db, copying covers, screens and game files...";
progressMaximum = dbRowReadChunks.size() + 1;
progressMaximum = dbRowReadChunks.size();
progressValue = 0;
int chunkCount = 0;
for (List<String> rowList : importManager.getDbRowReadChunks())

View File

@ -47,7 +47,7 @@ public class GamebaseImportWorker extends AbstractImportWorker
List<List<String>> dbRowReadChunks = importManager.getDbRowReadChunks();
progressValueString = "Importing to db and copying files...";
progressMaximum = dbRowReadChunks.size() + 1;
progressMaximum = dbRowReadChunks.size();
progressValue = 0;
publish("Importing to db, copying covers, screens and game files...");
int chunkCount = 0;

View File

@ -117,7 +117,7 @@ public class ImportProgressPanel extends JPanel
}
if (count > 0)
{
getTextArea().append("\nImport ended with " + count/6 + " errors. See log file for details.");
getTextArea().append("\nImport ended with " + count/6 + " errors. See pcusb.log for details.");
}
else
{