aboutsummaryrefslogtreecommitdiff
path: root/wrms.go
Commit message (Collapse)AuthorAgeFilesLines
* propagate the time bonus to the client and apply it when adding new songsFlorian Fischer2023-07-221-1/+7
|
* fixup! backend: support an incremental time bonusFlorian Fischer2023-07-221-6/+6
|
* increment the event id when holding the lock and the actual event occursFlorian Fischer2023-07-221-18/+20
|
* backend: support an incremental time bonusFlorian Fischer2023-07-211-1/+6
|
* implement playlist in order traversalFlorian Fischer2023-07-211-3/+3
| | | | This ensures that the initial reported song array is in order.
* do not remove active connections when removing stale onesFlorian Fischer2023-07-161-5/+19
| | | | | | | 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-7/+27
|
* add simple wrms testFlorian Fischer2023-07-011-1/+3
|
* introduce Player interface to allow multiple player implementationsFlorian Fischer2023-07-011-7/+7
|
* switch from websockets to SSEFlorian Fischer2023-06-301-21/+27
|
* fix double _next call and move mpv termination to NextFlorian Fischer2023-06-301-9/+15
| | | | | Due to an logic error was _next() a second time from runMpv after the mpv subprocess was terminated by the first Next() call.
* fix toggling of playing state in wrms.PlayPauseFlorian Fischer2023-06-301-4/+4
|
* cleanup Wrms._nextFlorian Fischer2023-06-301-5/+9
|
* fix condition in AdjustSongWeightFlorian Fischer2023-06-301-2/+1
|
* serialize player state change though a channelFlorian Fischer2023-06-301-2/+2
| | | | | Only the player.serveCmds and the runMpv goroutines are racing now. But this race should be a benign race.
* synchronize playback controlFlorian Fischer2023-06-011-17/+42
|
* take the lock when adding or modifying songsFlorian Fischer2023-06-011-5/+14
|
* actually increase the expected next event idFlorian Fischer2023-06-011-1/+2
|
* send events in a total orderFlorian Fischer2023-06-011-17/+123
| | | | | | | 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-15/+12
|
* support skipping the current song while playback is pausedFlorian Fischer2023-05-311-4/+13
|
* use an atomic pointer to track the current songFlorian Fischer2023-05-311-8/+9
| | | | | Also fix showing finished songs as current playing on new clients.
* prevent deadlocks when connections are closedFlorian Fischer2023-05-311-16/+56
| | | | | | | | | | | | | | | | | 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-0/+16
|
* distinguish between search queriesFlorian Fischer2023-05-301-4/+13
| | | | | | | | | | | 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.
* fix next song not beeing removed from the playlistFlorian Fischer2023-05-281-1/+2
|
* continue playback when adding a song to an empty queueFlorian Fischer2023-05-211-14/+21
| | | | | | | 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-21/+15
|
* add OnSongFinished backend hook allowing to remove uploaded songsFlorian Fischer2023-05-211-0/+2
|
* implement incremental search resultsFlorian Fischer2023-05-211-7/+25
| | | | TODO: ensure late search results do not show up for future searches
* paralyze searchingFlorian Fischer2023-05-211-1/+0
|
* export config members and pass the config to the client page templateFlorian Fischer2023-05-211-1/+1
| | | | Add a boolean to check for the upload backend in the template.
* llog: use variable argument listFlorian Fischer2022-12-281-10/+9
| | | | | | | 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.
* implement local storage backendv0.0.2-alphaFlorian Fischer2022-12-231-3/+6
| | | | | | | | 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.
* add and handle stop eventFlorian Fischer2022-08-011-0/+1
|
* fix player initialization and broadcast loggingFlorian Fischer2022-08-011-7/+7
|
* intermediate commitFlorian Fischer2022-07-271-12/+21
| | | | | | * use more llog * inform clients about their votes when initiating the connection * show song weights
* add youtube backendFlorian Fischer2022-07-261-1/+8
|
* intermediate commitFlorian Fischer2022-07-261-6/+8
| | | | | | | * 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
* WIP spotify playback commitFlorian Fischer2022-07-211-0/+5
| | | | | * display spotify search results in search overlay * synchronously play songs added from search
* intermediate commitFlorian Fischer2022-07-211-20/+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
* initial WIP commitFlorian Fischer2022-07-211-0/+172