bug fix where the list rating didnt update

This commit is contained in:
potzplitz 2024-08-09 18:14:58 +02:00
parent 184cde85d5
commit 0557862a0a
3 changed files with 7 additions and 13 deletions

View file

@ -7,14 +7,11 @@ import java.net.URL;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JOptionPane;
import javax.swing.JProgressBar;
import javax.swing.JScrollPane;
import javax.swing.JTextArea;
import api.GetApiData;
import gui.MainGUI;
import readsafefile.SafeFileManager;
import settingsfunctions.LoadSettings;
import settingsfunctions.MigrateData;

View file

@ -8,8 +8,6 @@ import java.util.ArrayList;
import org.apache.commons.io.FileUtils;
import org.json.JSONObject;
import database.DatabaseManager;
public class GuiData {
private ArrayList<String> localLevels = new ArrayList<String>();
@ -66,9 +64,6 @@ public class GuiData {
}
public void IndexData(ArrayList<String> migrate) throws IOException {
DatabaseManager mgr = new DatabaseManager();
File filelength = new File("C:\\ExtremeDemonList\\levels");
File[] filelengthindex = filelength.listFiles();

View file

@ -176,15 +176,17 @@ public class Sqlite {
}
public void queryData(String tablename) {
FetchData fetch = new FetchData();
for(int i = 0; i < fetch.allLevels().size(); i++) {
String sql = "SELECT * FROM " + tablename;
String sql = "SELECT * FROM " + tablename + " WHERE levelNameRaw = '" + fetch.allLevels().get(i) + "'";
try (Connection conn = DriverManager.getConnection(url);
Statement stmt = conn.createStatement();
ResultSet rs = stmt.executeQuery(sql)) {
// loop through the result set
while (rs.next()) {
levelname.add(rs.getString("levelname"));
levelID.add(rs.getInt("levelID") + "");
author.add(rs.getString("author"));
@ -200,14 +202,14 @@ public class Sqlite {
pbarr.add(rs.getString("personalBest"));
levelLength.add(rs.getString("levelLength"));
}
} catch (SQLException e) {
e.printStackTrace();
}
}
}
public void sortData(String tablename) throws SQLException {
FetchData data = new FetchData();