Commit Graph
520 Commits
Author SHA1 Message Date
anthorob d43e032c37 fix 2026-10-31 16:15:24 -04:00
anthorob d97c4c6da2 **Add autoplay support for seamless music playback**
Introduced autoplay functionality to keep music playing when the queue ends. Added new `/autoplay` API endpoints, command handling, and service implementations. Enhanced `TrackScheduler`, queue operations, and testing to support autoplay behavior. Integrated YouTube radio mix as the initial provider.
2026-10-31 16:13:04 -04:00
anthorob 764adb6cbc Refactor event handling into modular handlers
Introduce discrete event handlers (`InteractionHandlers`, `GuildLifecycleHandler`, `MessageReceivedHandler`, and more) to replace centralized logic in `EventsHandler`. Simplify handler registration, improve separation of concerns, and enable better testability. Added unit tests to verify isolated execution and failure resilience of handlers.
2026-10-30 22:31:25 -04:00
anthorob e989bff9e3 Remove search results limit in SearchResultHandler 2026-10-30 09:01:39 -04:00
anthorob 0863e0723b **Add playlist identifier to LoadPlaylistTask**
Introduced a new `playlistIdentifier` field in `LoadPlaylistTask` to enhance playlist tracking. Updated relevant method calls to include and utilize the identifier, ensuring more robust metadata management and consistency across the codebase.
2026-10-28 16:55:58 -04:00
anthorob 142cc77ec8 **Add playlist metadata support to queue and events**
Enhanced queueing functionality to include playlist metadata, such as name, identifier, and track count. Updated event payloads to handle playlist information and introduced a new `playlist_added` event for streamlined notifications. Adjusted tests and documentation to reflect these changes.
2026-10-28 16:34:38 -04:00
anthorob d376e245b7 Add author and duration to queue metadata
Included track author and duration in queue metadata. Adjusted key naming for consistency with snake_case formatting.
2026-10-28 04:48:54 -04:00
anthorob 6e99fe5477 **Add artwork URL to queue metadata**
Enhanced queue metadata by including the track's artwork URL in the serialized output. This allows clients to display album art or related visuals alongside track information.
2026-10-28 04:21:13 -04:00
anthorob dba7a84819 **Fix nickname retrieval in GuildRoutes**
Replaced `getNickname()` with `getEffectiveName()` to ensure the correct name is retrieved, falling back to the username when no nickname is set. This improves accuracy and consistency in member summaries.
2026-10-28 03:58:31 -04:00
anthorob 87ba09b001 **Improve event handling with new music and queue updates**
Added new `MusicEvent` types, including `TRACK_ERROR`, `TRACK_STUCK`, and `PLAYER_POSITION`, providing enhanced diagnostics and feedback. Improved queue mutation notifications by introducing granular events like `added`, `removed`, `moved`, `cleared`, and `shuffled`. Updated tests and documentation to reflect the changes, ensuring consistency and clarity across the event system.
2026-10-28 03:58:19 -04:00
anthorob 75b495b08c **Replace JDA with ShardProvider for improved sharding**
Refactored core classes and APIs to use `ShardProvider` instead of `JDA` directly. Added `ShardService` for managing shard connections and activity, improving scalability and separation of concerns. Integrated test coverage to validate shard-level operations and bot endpoints.
2026-10-28 02:59:24 -04:00
anthorob b0664e8835 **Add webhook event publishing for music state changes**
Introduced webhook event publishing to push music-state updates to a configured endpoint. Implemented `WebhookDispatcher` and `NoopEventPublisher` for dispatching events asynchronously or disabling them when no URL is set. Added handling of events like track start/end, queue updates, volume changes, and voice connection changes, enhancing integration with external systems.
2026-10-26 11:43:07 -04:00
anthorob 7443cbfb4b **Refactor command usage printing into CommandUsageFormatter**
Extracted command usage formatting logic from `CommandContainer` into a dedicated `CommandUsageFormatter` class, improving separation of concerns and maintainability. Updated `CommandManager` initialization and added comprehensive unit tests to validate the formatter's functionality.
2026-10-26 09:49:56 -04:00
anthorob f96c2677b6 **Add unit tests for command framework preconditions**
Introduced comprehensive unit tests for precondition classes, including `DisabledCommandPrecondition`, `GuildOnlyPrecondition`, `SlashCommandOnlyPrecondition`, and `PermissionPrecondition`. Also added integration tests for `CommandManager` and `CommandProcessor` to validate functionality.
2026-10-24 05:39:06 -04:00
anthorob 8e4e77cd31 Rename SLASH type to CHAT in command framework.
Replaced all references to the `SLASH` command type with `CHAT` for improved clarity and alignment with its intended functionality. Updated relevant classes, methods, and test cases to reflect this change.
2026-10-24 05:32:51 -04:00
anthorob 10462a08a4 remove old files 2026-10-19 23:55:17 -04:00
anthorob 389af563b9 update docs 2026-10-19 08:21:42 -04:00
anthorob d3211c6702 Add vote-skip status endpoint and response DTO
Introduced the `GET /music/{guildId}/vote-skip` endpoint to retrieve the current vote-skip status of the playing track. Added `VoteSkipStatusResponse` DTO and OpenAPI schema for clear response structure. Updated `MusicManager` to expose the vote-skip threshold and integrated related logic into `MusicRoutes`.
2026-10-18 09:46:08 -04:00
anthorob f6ba30639a Add identifier field to PendingPlaylist in PlayOutcome
Updated `PendingPlaylist` to include a new `identifier` field, enabling more precise playlist identification. Adjusted `SearchResultHandler` and `MusicRoutes` to use and expose this field, ensuring integration across the system and improving API consistency.
2026-10-18 08:23:56 -04:00
anthorob 780016b731 Split QueueResponse and introduce SearchResponse
Decoupled `QueueResponse` and `SearchResponse` to better align with their distinct API endpoints and simplify response structures. Updated `PlayOutcome.PendingPlaylist` and `SearchResultHandler` to include playlist `name`, ensuring consistency across related features and improving response clarity. Adjusted OpenAPI documentation and routes to reflect the separation.
2026-10-18 05:35:57 -04:00
anthorob 01bf94c60a Switch to maven-dependency-plugin and adjust build output
Replaced `maven-shade-plugin` with `maven-dependency-plugin` for dependency management, simplifying the build process and separating runtime dependencies into a dedicated `lib/` directory. Updated `Dockerfile` and GitHub Actions config to account for these changes, ensuring all dependencies are correctly packaged and deployed.
2026-10-18 02:10:38 -04:00
anthorob dad2e0356e Introduce multistage Docker build for optimized image size
Implemented a multistage Docker build, separating build and runtime stages to reduce the final image size and improve security. Adjusted `.dockerignore` to exclude unnecessary files from the build context and updated the base JRE image to use the build output efficiently.
2026-10-18 02:04:56 -04:00
anthorob d0ea0535e2 Add health checks and dependency conditions in docker-compose.yml
Introduced health checks for `netneutrality-db` to ensure proper readiness before dependent services start. Replaced static sleep in `startup.sh` with dynamic database availability checks, improving startup reliability and reducing downtime risks.
2026-10-18 01:53:10 -04:00
anthorob 78d6ade17a Optimize isUserDj logic 2026-10-18 01:49:46 -04:00
anthorob cb47a1622f Refactor MusicAccess permission checks
Reordered admin check in `MusicAccess` for efficiency by prioritizing it before role-related logic. This improves readability and minimizes unnecessary role lookups for admin users.
2026-10-14 08:32:32 -04:00
anthorob 545c09d502 clean 2026-10-14 08:24:33 -04:00
anthorob 6134c893ab fix 2026-10-14 08:12:12 -04:00
anthorob 91b6de708d Standardize guild API endpoints and add music access checks
Unified paths in guild-related endpoints to include consistent `{guildId}` structure, improving endpoint clarity and alignment with REST routing conventions. Added centralized `MusicAccess` utility to streamline music feature permission checks, replacing scattered logic in `MusicCommand`. Updated OpenAPI documentation and added tests for new and updated behaviors.
2026-10-14 08:02:31 -04:00
anthorob bedc8b9f02 Switch to MariaDBDialect in Hibernate configuration
Replaced `MySQLDialect` with `MariaDBDialect` in `hibernate.cfg.xml` to ensure compatibility with MariaDB. This change aligns the Hibernate dialect with the underlying database and avoids potential SQL compatibility issues.
2026-10-13 13:18:10 -04:00
anthorob abdd2d1656 Replace GitLab integration with Gitea in issue reporting
Migrated issue reporting functionality from GitLab to Gitea. Updated environment variables, dependencies, and configuration references to support Gitea. Introduced `GiteaClient` for communication with the Gitea API and refactored related code and tests to align with the new integration.
2026-10-13 13:16:54 -04:00
anthorob a23e3843ed Filter out public roles in guild routes 2026-10-09 13:16:54 -04:00
anthorob 1f126f29ad Switch to SIGTERM for graceful shutdown in startup.sh
Replaced the `curl` HTTP shutdown call with a `kill -TERM` signal to ensure the JVM shutdown hook executes cleanly. Added a `wait` command to block until the process finishes, enabling a more reliable and proper termination process.
2026-10-09 12:51:35 -04:00
anthorob e0ec43813d Add admin status check endpoint to guild routes
Introduced `/guilds/members/{guildId}/{userId}/admin` endpoint to determine if a guild member is an admin. Added `AdminStatusResponse` DTO and documented the new route with OpenAPI annotations. This feature allows for efficient admin status verification with fallback to REST fetch on cache miss.
2026-10-09 12:43:44 -04:00
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
anthorob 4b006956b5 Add filters to Maven shade plugin configuration
Added filters to exclude specific files and artifacts from the shaded JAR to reduce unnecessary metadata and dependencies. These changes optimize the final build output and ensure a cleaner, more efficient artifact.
2026-10-04 15:18:45 -04:00
anthorob 2293629f6f Add logger configuration for Lavalink client
Introduced a dedicated logger `dev.arbjerg.lavalink` with `info` level and disabled additivity. Updated the log4j2 configuration to log Lavalink client activity to both console and rolling file appenders, ensuring better log separation and monitoring.
2026-10-04 15:13:15 -04:00
anthorob 5b1df7038c fix PermissionPrecondition 2026-10-04 15:05:11 -04:00
anthorob 88389f3db0 Remove redundant announce calls from MusicRoutes 2026-10-03 18:35:30 -04:00
anthorob c2a24f0133 Clear queue on leave operation
Added a call to `getQueueManager().clearQueue()` in the leave method of `MusicManager`. This ensures the queue is properly cleared when the bot disconnects from a guild, improving consistency and preventing leftover queue data.
2026-10-03 18:26:27 -04:00
anthorob db86c133e6 Add new endpoints for queue management and playback control
Introduced `/music/{guildId}/queue` DELETE, `/music/{guildId}/leave`, and `/music/{guildId}/shuffle` endpoints for enhanced queue and playback operations. Added corresponding DTOs (`DeleteQueueResponse`, `LeaveResponse`, `ShuffleResponse`) and updated `MusicRoutes` with OpenAPI documentation. These changes improve queue handling, bot disconnection, and randomization functionality for guilds.
2026-10-03 18:21:10 -04:00
anthorob 44b284fde8 Add GET /music/{guildId}/volume endpoint
Introduced a new endpoint to retrieve the current volume level for a guild's music player. Updated `MusicRoutes` and `MusicManager` with the necessary logic and added OpenAPI documentation for the route. This enhances API completeness by providing both read and write access to the volume setting.
2026-10-03 15:46:34 -04:00
anthorob 9812e6da41 Add DJ status check endpoint to music routes
Introduced `/music/{guildId}/dj/{userId}` endpoint to verify if a user has DJ permissions in a specific guild. Added `DjStatusResponse` DTO, integrated the logic into `MusicManager`, and provided OpenAPI documentation for the new route.
2026-10-03 14:34:32 -04:00
anthorob 30ff1602b2 Add seek and reorder queue functionality to music routes
Introduced `/music/{guildId}/seek` and `/music/{guildId}/queue/reorder` endpoints, enabling users to seek to a specific position in the currently playing track and reorder tracks in the queue. Added corresponding request/response DTOs and OpenAPI documentation. Updated `QueueManager` with a `reorder` method and added comprehensive unit tests for edge cases and validation.
2026-10-03 14:06:29 -04:00
anthorob 470f5a33aa Refactor music commands to return QueueActionResult
Replaced `CommandExecutionResult` with `QueueActionResult` in music-related commands, improving result clarity and alignment with queue-specific operations. Updated command logic, tests, and REST API endpoints to use the new result type, ensuring consistent handling and messaging.
2026-10-03 13:54:04 -04:00
anthorob 9cd1317659 Support bulk queuing with queueAll in /music/{guildId}/queue
Extended the queue endpoint to allow bulk queuing of all search candidates by specifying `queueAll=true`. Updated relevant request and response DTOs, OpenAPI documentation, and endpoint logic to handle bulk queuing while maintaining input validation for individual candidates.
2026-10-03 12:17:37 -04:00
anthorob 27aa0a1d55 Add artwork_url to music track summaries
Extended the music track summary object in `MusicRoutes` to include the `artwork_url` field. This provides front-end clients with direct access to track artwork, improving UI and metadata presentation.
2026-10-03 12:04:55 -04:00
anthorob 715c5a5fb9 Add search_id_ttl_seconds to pending music responses
Enhanced pending response bodies in `MusicRoutes` to include `search_id_ttl_seconds`, indicating the time-to-live for `search_id`. Updated `QueueResponse` DTO and comments to support the new field. Introduced `ttlSeconds` method in `PendingSearchResults` for consistent TTL retrieval across components.
2026-10-03 12:02:14 -04:00
anthorob cd83fcdae6 Handle unavailable audio node in MusicManager
Added a check for null `getLink()` in `MusicManager` before attempting connection to the audio channel. This ensures users receive a clear error message if the audio node is unavailable, improving error handling and user feedback.
2026-10-03 11:51:17 -04:00
anthorob 1dca5b898a Rename PlayRequest/PlayResponse to QueueRequest/QueueResponse
Updated DTOs and endpoint logic to reflect the separation of search result resolution and playback queuing. Adjusted references to `/play` and `/play/select` routes, replacing them with clearer `/search` and `/queue` endpoints in comments, documentation, and API definitions.
2026-10-03 11:23:59 -04:00