aboutsummaryrefslogtreecommitdiff
path: root/main.go
Commit message (Collapse)AuthorAgeFilesLines
* make time bonus config value usable through yamlFlorian Fischer2023-07-311-1/+2
|
* implement initial loading of spotify playlistsFlorian Fischer2023-07-311-0/+5
| | | | | | | | Playlist can now be added to the initial play queue with the -playlists command line flag or the playlists yaml key in the config file. To load a spotify playlist the link obtained when sharing the playlist from spotify is used.
* fix deadlock when ordering the broadcasted eventsFlorian Fischer2023-07-281-2/+4
| | | | | | | Do not increment the global event id when sending "private" events like the initial commands and search results. Fixes: a93c5826172f835db604a2646d470ecfd72484cf
* do not increment the global event count when reporting search eventsFlorian Fischer2023-07-281-3/+3
|
* backend: support an incremental time bonusFlorian Fischer2023-07-211-0/+2
|
* do not remove active connections when removing stale onesFlorian Fischer2023-07-161-1/+1
| | | | | | | If the connection is renewed by the client removing the old connection and adding the new one is racy. Fix this by remembering a connection generation number and only to prevent removing the new connection.
* add more song info and preparations for advanced searchFlorian Fischer2023-07-161-6/+14
|
* add admin-password and button to become admin from the clientFlorian Fischer2023-07-031-10/+25
|
* switch from websockets to SSEFlorian Fischer2023-06-301-14/+11
|
* send events in a total orderFlorian Fischer2023-06-011-91/+11
| | | | | | | Move Connection code to wmrs.go. Introduce a RWMutex to synchronize access to the internal Wrms state. Tag each event when it is broadcast with the next event count. Senders will order the broadcasted events. This guarantees that no obsoltete events are ever delivered.
* tag all events with a monotonic id in order to ignore outdated onesFlorian Fischer2023-05-311-11/+6
|
* create websocket context after successfully identifying the connectionFlorian Fischer2023-05-311-4/+3
| | | | Fixes: d8bdce51c336f3693121202402ee38ff3f12c0e2
* use an atomic pointer to track the current songFlorian Fischer2023-05-311-1/+5
| | | | | Also fix showing finished songs as current playing on new clients.
* send bad request status if the websocket connection has a bad UUID cookieFlorian Fischer2023-05-311-0/+4
|
* prevent deadlocks when connections are closedFlorian Fischer2023-05-311-3/+3
| | | | | | | | | | | | | | | | | Currently the unbounded Events channel is never closed and Connection are not removed from WRMS therefore any call to Broadcast deadlocks because the wsEndpoint consumer is no longer reading Events. Prevent this deadlock with a combination of announcing the closing of connections and sender counting for each connection. Before a sender is trying to write to the Events channel it checks if it is already closed. If it observes that the connection is open it registers itself as sender send the Event and unregisters itself. The wsEndpoint announces that the connection is closed and consumes Events until no registered senders are left. Then it closed the Events channel and terminates.
* allow admins to skip or delete songsFlorian Fischer2023-05-311-3/+34
|
* distinguish between search queriesFlorian Fischer2023-05-301-6/+17
| | | | | | | | | | | Introduce a new Id field for events to distinguish between different searches. Since search result reporting is split up a old search could introduce results or terminate the current search. Keep track of a search counter to distinguish between result from the active search and stale ones. Allow to add multiple songs from the current search.
* allow loglevel to be specifies in config fileFlorian Fischer2023-05-281-2/+2
|
* continue playback when adding a song to an empty queueFlorian Fischer2023-05-211-1/+0
| | | | | | | Now WRMS only switches the playback state when an admin calls the /playpause endpoint. When the queue runs out of songs the state is kept and continues when a new song is added.
* implement YAML config and admin connectionsFlorian Fischer2023-05-211-20/+75
|
* add info message when startingFlorian Fischer2023-05-211-0/+1
|
* misc cleanupsFlorian Fischer2023-05-211-2/+2
| | | | Reported-By: myOmikron <git@omikron.dev>
* implement incremental search resultsFlorian Fischer2023-05-211-19/+30
| | | | TODO: ensure late search results do not show up for future searches
* paralyze searchingFlorian Fischer2023-05-211-1/+11
|
* export config members and pass the config to the client page templateFlorian Fischer2023-05-211-9/+11
| | | | Add a boolean to check for the upload backend in the template.
* llog: use variable argument listFlorian Fischer2022-12-281-19/+19
| | | | | | | Mirror more closely the fmt interface and reduce the verbosity of the log call sites. Additionally the log message is only created if we are actually going to log it.
* port log usage to llogFlorian Fischer2022-12-231-23/+21
|
* make log level configurablev0.0.3-alphaFlorian Fischer2022-12-231-0/+3
|
* implement local storage backendv0.0.2-alphaFlorian Fischer2022-12-231-4/+14
| | | | | | | | The 'local' backend is able to serve the music from a path specified by '-server-music-dir'. Add command line options to select the server port as well as a list of backends.
* intermediate commitFlorian Fischer2022-07-271-9/+41
| | | | | | * use more llog * inform clients about their votes when initiating the connection * show song weights
* intermediate commitFlorian Fischer2022-07-261-3/+3
| | | | | | | * use mpv to play songs * fix CurrentSong being a pointer to a changing slot in the playlist array * wire up play and pause * continue playing after a song is finished
* intermediate commitFlorian Fischer2022-07-211-6/+25
| | | | | | | | | * add dummy backend * enable spotify searching * JS: use let instead of var * improve logging * support adding new songs from search * rename Song.Id to Song.Uri
* start implementing song searchFlorian Fischer2022-07-211-4/+14
|
* initial WIP commitFlorian Fischer2022-07-211-0/+162