Compare commits

...
2 Commits
Author SHA1 Message Date
anthorob 861b3f90e7 Refine VoteSkipService warnings and remove redundant announce calls
Updated the warning message in `VoteSkipService` to provide more precise feedback when attempting to vote on an empty queue. Removed an unnecessary `announce` call in `MusicRoutes`'s `resumePlayback` for cleaner and more concise code execution.
2026-10-09 03:16:09 -04:00
anthorob b7d19b6d56 Modify database URL to create missing databases
Updated the database connection URL to include the `createDatabaseIfNotExist=true` parameter. This ensures the database is automatically created if it does not already exist, improving usability and reducing manual configuration steps.
2026-10-09 02:41:02 -04:00
3 changed files with 4 additions and 4 deletions

No files matched your search

@@ -38,7 +38,8 @@ public record DatabaseConfig(String url, String user, String password) {
String dbPass = settings.get("MYSQL_PASSWORD", "");
String dbHost = settings.get("MYSQL_HOST", "localhost");
String dbPort = settings.get("MYSQL_PORT", "3306");
return new DatabaseConfig(String.format("jdbc:mysql://%s:%s/%s", dbHost, dbPort, dbName), dbUser, dbPass);
String url = String.format("jdbc:mysql://%s:%s/%s?createDatabaseIfNotExist=true", dbHost, dbPort, dbName);
return new DatabaseConfig(url, dbUser, dbPass);
}
@Override
@@ -221,7 +221,6 @@ public final class MusicRoutes {
private static void resumePlayback(Supplier<JDA> jdaSupplier, MusicService musicService, Context ctx) {
MusicManager manager = manager(jdaSupplier, musicService, ctx);
manager.unpauseTrack();
announce(manager, "Resuming current track");
ctx.json(Map.of("status", "ok", "message", "Resuming current track"));
}
@@ -347,7 +346,7 @@ public final class MusicRoutes {
MusicManager manager = musicService.get(guild);
String userId = ctx.pathParam("userId");
CacheOrFetch.<Member>resolve(
CacheOrFetch.resolve(
ctx,
() -> guild.getMemberById(userId),
() -> guild.retrieveMemberById(userId),
@@ -56,7 +56,7 @@ public class VoteSkipService {
TrackInfo info = queueManager.peekHeadOfQueue();
if (info == null) {
return QueueActionResult.warn("Queue is empty");
return QueueActionResult.warn("The queue is empty, you can't cast a vote on an empty queue");
}
// Minus the bot itself