Merge branch 'main' into release
This commit is contained in:
commit
b361e37de6
8 changed files with 81 additions and 19 deletions
11
pom.xml
11
pom.xml
|
@ -37,11 +37,22 @@
|
|||
<artifactId>jdash-client</artifactId>
|
||||
<version>4.0.5</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.xerial</groupId>
|
||||
<artifactId>sqlite-jdbc</artifactId>
|
||||
<version>3.45.2.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>javazoom</groupId>
|
||||
<artifactId>jlayer</artifactId>
|
||||
<version>1.0.1</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>ch.qos.logback</groupId>
|
||||
<artifactId>logback-classic</artifactId>
|
||||
<version>1.2.10</version>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
<build>
|
||||
<sourceDirectory>src</sourceDirectory>
|
||||
|
|
|
@ -1,9 +0,0 @@
|
|||
package data;
|
||||
|
||||
public class FetchGDData {
|
||||
|
||||
public void getSongData() {
|
||||
|
||||
}
|
||||
|
||||
}
|
15
src/database/DatabaseManager.java
Normal file
15
src/database/DatabaseManager.java
Normal file
|
@ -0,0 +1,15 @@
|
|||
package database;
|
||||
|
||||
public class DatabaseManager {
|
||||
|
||||
public void manage() {
|
||||
Sqlite sql = new Sqlite("test");
|
||||
if(sql.exists()) {
|
||||
System.out.println(true);
|
||||
} else {
|
||||
System.out.println(false);
|
||||
sql.createNewDatabase();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
38
src/database/Sqlite.java
Normal file
38
src/database/Sqlite.java
Normal file
|
@ -0,0 +1,38 @@
|
|||
package database;
|
||||
|
||||
import java.io.File;
|
||||
import java.sql.Connection;
|
||||
import java.sql.DatabaseMetaData;
|
||||
import java.sql.SQLException;
|
||||
import java.sql.DriverManager;
|
||||
|
||||
public class Sqlite {
|
||||
|
||||
private static String url = "jdbc:sqlite:C:\\ExtremeDemonList\\database\\sqlite\\";
|
||||
private static String filename;
|
||||
|
||||
public Sqlite(String dbname) { // setzt variablen
|
||||
url += dbname + ".db";
|
||||
filename = dbname + "";
|
||||
|
||||
}
|
||||
|
||||
public boolean exists() { // überprüft, ob datenbank existiert
|
||||
|
||||
File file = new File("C:\\ExtremeDemonList\\database\\sqlite\\" + filename + ".db");
|
||||
if(file.exists()) {
|
||||
return true; // ja
|
||||
} else {
|
||||
return false; // nein
|
||||
}
|
||||
}
|
||||
|
||||
public void createNewDatabase() { // erstellt eine neue datenbank
|
||||
try (Connection conn = DriverManager.getConnection(url)) {
|
||||
DatabaseMetaData meta = conn.getMetaData();
|
||||
|
||||
} catch(SQLException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
|
@ -4,6 +4,7 @@ public class FirstlaunchMain {
|
|||
|
||||
public void main() {
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -7,6 +7,7 @@ import javax.swing.UnsupportedLookAndFeelException;
|
|||
import api.GetApiData;
|
||||
import data.FetchData;
|
||||
import data.ManageFiles;
|
||||
import database.DatabaseManager;
|
||||
import filestructure.CreateFileStructure;
|
||||
import gui.LoadMenu;
|
||||
|
||||
|
@ -27,10 +28,15 @@ public class Main {
|
|||
FetchData fetch = new FetchData();
|
||||
fetch.getGithubString();
|
||||
|
||||
load.updateBar("Liste wird auf Updates geprüft...");
|
||||
load.updateBar("Einträge werden Indexiert...");
|
||||
|
||||
ManageFiles manager = new ManageFiles();
|
||||
manager.compareArrays();
|
||||
manager.compareArrays();
|
||||
|
||||
load.updateBar("Datenbank wird geladen...");
|
||||
|
||||
DatabaseManager data = new DatabaseManager();
|
||||
data.manage();
|
||||
|
||||
load.updateBar("Ladevorgang abgeschlossen");
|
||||
load.close();
|
||||
|
|
|
@ -32,13 +32,13 @@ public class PlaySong {
|
|||
}
|
||||
|
||||
private void playSong(String path) {
|
||||
String filePath = path; // Passe den Pfad zu deiner MP3-Datei an
|
||||
String filePath = path;
|
||||
|
||||
try {
|
||||
FileInputStream fis = new FileInputStream(filePath);
|
||||
AdvancedPlayer player = new AdvancedPlayer(fis);
|
||||
|
||||
// Starte das Abspielen in einem neuen Thread, damit der Hauptthread nicht blockiert wird
|
||||
|
||||
Thread playerThread = new Thread(() -> {
|
||||
try {
|
||||
player.play();
|
||||
|
@ -49,16 +49,15 @@ public class PlaySong {
|
|||
|
||||
playerThread.start();
|
||||
|
||||
// Gib dem Player Zeit, die MP3-Datei abzuspielen
|
||||
Thread.sleep(10000); // Zum Beispiel 10 Sekunden abwarten
|
||||
|
||||
// Beende den Player und schließe die FileInputStream
|
||||
Thread.sleep(10000);
|
||||
|
||||
|
||||
player.close();
|
||||
fis.close();
|
||||
} catch (FileNotFoundException | JavaLayerException | InterruptedException e) {
|
||||
} catch (IOException | JavaLayerException | InterruptedException e) {
|
||||
e.printStackTrace();
|
||||
} catch (IOException e) {
|
||||
// TODO Auto-generated catch block
|
||||
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
|
|
|
@ -13,4 +13,5 @@
|
|||
requires jdash.client;
|
||||
requires jdash.common;
|
||||
requires jlayer;
|
||||
requires java.sql;
|
||||
}
|
Loading…
Reference in a new issue