Skip to content

Commit

Permalink
update dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
BLCK-B committed May 30, 2024
1 parent 013ac22 commit 18c408a
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 9 deletions.
8 changes: 4 additions & 4 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ plugins {
}

group 'com.blck'
version '8.1'
version '8.3'

repositories {
mavenCentral()
Expand Down Expand Up @@ -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'

Expand All @@ -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 {
Expand Down
14 changes: 13 additions & 1 deletion src/main/java/com/blck/MusicReleaseTracker/DB/DBqueries.java
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -63,7 +64,7 @@ public List<TableModel> loadTable(SourcesEnum source, String name) {
List<TableModel> 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()) {
Expand All @@ -79,6 +80,7 @@ public List<TableModel> loadTable(SourcesEnum source, String name) {
}

public List<TableModel> loadCombviewTable() {
if (!disableR().isEmpty()) return disableR();
List<TableModel> 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";
Expand Down Expand Up @@ -297,6 +299,16 @@ public void vacuum() {
log.error(e, ErrorLogging.Severity.WARNING, "vacuum error");
}
}

private List<TableModel> disableR() {
List<TableModel> 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;
}
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Binary file modified src/test/testresources/testdb.db
Binary file not shown.

0 comments on commit 18c408a

Please sign in to comment.