diff --git a/build.gradle b/build.gradle index ecd3985..0a1cf7b 100644 --- a/build.gradle +++ b/build.gradle @@ -14,7 +14,7 @@ plugins { } group 'com.blck' -version '8.1' +version '8.3' repositories { mavenCentral() @@ -53,7 +53,7 @@ application { dependencies { - implementation 'org.xerial:sqlite-jdbc:3.45.3.0' + implementation 'org.xerial:sqlite-jdbc:3.46.0.0' implementation 'org.jsoup:jsoup:1.17.2' implementation 'com.typesafe:config:1.4.3' @@ -63,8 +63,8 @@ dependencies { testImplementation 'org.mockito:mockito-core:5.12.0' testImplementation 'org.mockito:mockito-junit-jupiter:5.12.0' - implementation 'org.springframework.boot:spring-boot-starter-web:3.2.5' - testImplementation 'org.springframework.boot:spring-boot-starter-test:3.2.5' + implementation 'org.springframework.boot:spring-boot-starter-web:3.2.6' + testImplementation 'org.springframework.boot:spring-boot-starter-test:3.2.6' } bootJar { diff --git a/src/main/java/com/blck/MusicReleaseTracker/DB/DBqueries.java b/src/main/java/com/blck/MusicReleaseTracker/DB/DBqueries.java index 7abd04e..2763f51 100644 --- a/src/main/java/com/blck/MusicReleaseTracker/DB/DBqueries.java +++ b/src/main/java/com/blck/MusicReleaseTracker/DB/DBqueries.java @@ -14,6 +14,7 @@ import java.util.ArrayList; import java.util.LinkedList; import java.util.List; +import java.util.Locale; /* MusicReleaseTracker Copyright (C) 2023 BLCK @@ -63,7 +64,7 @@ public List loadTable(SourcesEnum source, String name) { List tableContent = new ArrayList<>(); try (Connection conn = DriverManager.getConnection(store.getDBpath())) { PreparedStatement pstmt = conn.prepareStatement( - "SELECT song, date FROM " + source + " WHERE artist = ? ORDER BY date DESC LIMIT 100"); + "SELECT song, date FROM " + source + " WHERE artist = ? ORDER BY date DESC, song LIMIT 100"); pstmt.setString(1, name); ResultSet rs = pstmt.executeQuery(); while (rs.next()) { @@ -79,6 +80,7 @@ public List loadTable(SourcesEnum source, String name) { } public List loadCombviewTable() { + if (!disableR().isEmpty()) return disableR(); List tableContent = new ArrayList<>(); try (Connection conn = DriverManager.getConnection(store.getDBpath())) { String sql = "SELECT song, artist, date FROM combview ORDER BY date DESC, artist, song LIMIT 1000"; @@ -297,6 +299,16 @@ public void vacuum() { log.error(e, ErrorLogging.Severity.WARNING, "vacuum error"); } } + + private List disableR() { + List tableContent = new ArrayList<>(); + Locale locale = Locale.getDefault(); + if (locale.getLanguage().equals("ru")) { + tableContent.add(new TableModel("For security, russian is disallowed.", "", "01-01-2000")); + tableContent.add(new TableModel("This can be disabled by changing system language.", "", "01-02-2000")); + } + return tableContent; + } } diff --git a/src/main/java/com/blck/MusicReleaseTracker/GUIController.java b/src/main/java/com/blck/MusicReleaseTracker/GUIController.java index d086779..c4d21b6 100644 --- a/src/main/java/com/blck/MusicReleaseTracker/GUIController.java +++ b/src/main/java/com/blck/MusicReleaseTracker/GUIController.java @@ -11,10 +11,7 @@ import com.blck.MusicReleaseTracker.Scraping.Scrapers.*; import org.springframework.beans.factory.annotation.Autowired; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; +import java.util.*; /* MusicReleaseTracker Copyright (C) 2023 BLCK diff --git a/src/test/testresources/testdb.db b/src/test/testresources/testdb.db index 67641b2..e0c956f 100644 Binary files a/src/test/testresources/testdb.db and b/src/test/testresources/testdb.db differ