Releases: BytePhilHD/SpotifyLink
Release list
v1.4.2 - Bug fixes
Full Changelog: v1.4.0...v1.4.2
v1.4.0 - Performance improvements
v1.4.0
Highlights
Clients no longer poll the server. The server now watches Spotify centrally and pushes
updates through the existing WebSocket only when something actually changed. Previously
every client sent a refresh request every 2 seconds, regardless of whether anything had
changed — with 50 guests that was ~25 requests per second for roughly one real change
every 3 minutes.
Changed
- Push instead of polling: one central Spotify poll per second, broadcast on change only.
Updates now arrive when they happen instead of up to 2 seconds later. - The queue is only polled while at least one client has it open (new
queue-subscribeaction). - No Spotify requests at all when no client is connected or while playback is paused.
- Search input is debounced by 250 ms instead of firing one Spotify search per keystroke.
- The Spotify display name is cached instead of being requested for every admin update.
- Admin actions (play/pause, next, back, new session code) trigger an immediate push.
default.cfgnow shipswebaddress=http://127.0.0.1:80/for local first-time setup.
Fixed
- Reconnects stacked refresh timers:
setIntervallived inside the socket setup and was
never cleared, so every reconnect added another timer permanently. Replaced by a single
reconnect timer with exponential backoff (1s → 15s). - The first request for the current track or the queue always returned
null. - Admin-only fields were written into the shared cache object, which leaked the session
code and the Spotify display name to regular guests. - The orange "already requested" marker never worked — the client read
isInQueue/
playedwhile the server sendsinQueue. - Concurrent writes to the same WebSocket from the push loop and the message handler could
throwWritePendingException; writes are now serialized per client. - A failed write no longer drops a client whose connection is still open.
Internal
- New
BroadcastService(session registry, poll loop, change detection) andClientSession. refreshnow only delivers the initial state after connecting.
v1.3.1 - Bug fixes and visual optimizations for PC
Fixed huge bug which stopped SpotifyLink from working.
PC optimizations
Bug fixes
v1.2.3 - Bug fix and optimizations
Fixed Out of array boundaries bug when searching.
Full Changelog: v1.2.2...v1.2.3
v1.2.2 - Performance improvements
This release includes several changes to improve the functionality and user experience of the SpotifyLink application. The main changes involve updating the version number, adjusting timing intervals, removing redundant code, and enhancing the user interface.
Version Update:
pom.xml: Updated the version from1.2.1to1.2.2.
Timing Interval Adjustments:
src/main/de.bytephil/authorization/SpotifyAPIConnector.java: Reduced the interval for checking the current track info from 2 seconds to 1 second.src/main/de.bytephil/handlers/SpotifyHandler.java: Reduced the interval for getting the queue as song objects from 3 seconds to 1 second.
Code Simplification:
src/main/de.bytephil/main/Main.java: Removed redundant code for handling the username when the song is not playing.
User Interface Enhancements:
src/main/resources/WebPages/assets/script/mainpage.js: Added initialization forsongAddedandcountervariables to improve the display message when a song is added.src/main/resources/WebPages/assets/script/mainpage.js: Improved the readability of the message displayed when an incorrect session code is entered.
v1.2.1 - Session Code fix
Session code gets now displayed all the time on the admin page instead of just when a song is playing and a user is logged in.
v1.2.0 - Added session codes
This version includes several changes to the SpotifyLink project, focusing on adding session management, improving the user interface, and refactoring the code for better organization and readability. The most important changes are grouped by theme below.
Session Management Improvements:
- Added
sessionCodegeneration and validation methods in theMainclass to manage user sessions. (src/main/de.bytephil/main/Main.java, [1] [2] [3] [4] - Updated WebSocket message handling to include session code validation and actions based on user type (ADMIN, USER, FORBIDDEN). (
src/main/de.bytephil/main/Main.java, [1] [2] [3] [4] [5]
User Interface Enhancements:
- Modified
admin.htmlto display and manage session codes, including buttons for sharing and regenerating the session code. (src/main/resources/WebPages/admin.html, [1] [2] - Updated
adminscript.jsto handle session code display and sharing functionality. (src/main/resources/WebPages/assets/script/adminscript.js, [1] [2] [3] [4]
Code Refactoring:
- Refactored WebSocket message handling in
adminscript.jsto use a unified data structure for sending actions and content. (src/main/resources/WebPages/assets/script/adminscript.js, src/main/resources/WebPages/assets/script/adminscript.jsL140-R155) - Removed redundant code and improved readability in the
Mainclass by consolidating message handling logic. (src/main/de.bytephil/main/Main.java, [1] [2]
New Features:
- Added a new
UserTypeenum to manage different user roles within the application. (src/main/de.bytephil/enums/UserType.java, src/main/de.bytephil/enums/UserType.javaR1-R5) - Introduced a secure random session code generator to enhance session management security. (
src/main/de.bytephil/main/Main.java, src/main/de.bytephil/main/Main.javaR300-R326)
Minor Changes:
- Updated the project version in
pom.xmlto 1.2.0. (pom.xml, pom.xmlL10-R10) - Removed unnecessary imports and print statements to clean up the codebase. (
src/main/de.bytephil/main/Main.java, [1] [2]
v1.1.0 - Added User queue and improved performance / errors
Added new functionality to show the current user queue. This can be shown by clicking dropdown button. The next 3 songs are then shown in 'Real-Time' (every 3 seconds).
Heavily reduced load on Spotify API by making synchronized get functions which only request every 2 (current Song) and 3 (queue songs) seconds.
Dependency Updates:
- Upgraded project version from
1.0.8to1.1.0inpom.xml. - Added
lombokdependency inpom.xmlto simplify code with annotations.
Error Handling Improvements:
- Replaced specific exception handling with a general
Exceptioncatch block and improved error logging inAuthenticationURI.javaandSpotifyAPIConnector.java. [1] [2] - Updated
SearchRequest.javato useConsole.printErrorfor consistent error logging. [1] [2] [3]
New Features:
- Introduced
SongObjectclass to represent song details, withlombokannotations for getters, setters, and constructors. - Added methods in
SpotifyHandler.javato fetch and cache Spotify queue asSongObjectinstances.
Code Cleanup:
- Removed unused imports and methods in
SpotifyAPIConnector.javaandAuthenticationURI.java. [1] [2] [3] - Deleted
ConsoleCommandHandler.javaas it was no longer needed.
Additional Changes:
- Enhanced
Main.javato handle application startup state and integrate the new queue fetching feature. [1] [2] [3]
v1.0.8 - Bug Fixes and Performance Improvements
Dependency Updates:
- Updated the version of the project from
1.0-SNAPSHOTto1.0.8inpom.xml. - Upgraded the
spotify-web-api-javadependency from version8.4.1to9.0.0inpom.xml.
Code Refactoring:
- Refactored constant variables
clientIdandclientSecretto uppercase (CLIENT_IDandCLIENT_SECRET) inAuthenticationURI.java,SpotifyAPIConnector.java, andSearchRequest.java[1] [2] [3]. - Removed unused import statements and reordered them in
AuthenticationURI.java,SearchRequest.java, andServerConfiguration.java[1] [2] [3].
WebSocket Enhancements:
- Enhanced WebSocket setup to support both
wsandwssprotocols inadminscript.jsandmainpage.js[1] [2]. - Modified the WebSocket refresh function to send "refresh-Admin" instead of "refresh" in
adminscript.js.
Error Handling Improvements:
- Improved error handling in
Main.javaby catching specific exceptions (IOException,ParseException,SpotifyWebApiException) and printing stack traces for unexpected errors.
Documentation Update:
- Added a new section "Developing" to
README.mdwith instructions on settingclientIDandclientSecretvalues and building the project with Maven.
v1.0.7 - Added Spotify account switch button
Added information of currently logged in Spotify account on admin page with the option to change it. By clicking on the switch button, you get redirected to the Spotify authorization page and after that directly redirected to the main page, now connected with your account.
What's Changed
- Change Spotify Account through admin page by @BytePhilHD in #7
Full Changelog: v1.0.6...v1.0.7