Removed a code for reading of a playlist file from a Playlist struct, let it be simpler. load() func became LoadFromPlaintext() to parse a plaintext content. Also fixed a wrong use of defer inside a switch, it simply doesn't work like that as it is scoped to a func, not a block.
master
Alexander "Arav" Andreev2025-01-15 23:35:41 +04:00
There is a periodic panic because of out of bounds in GetDuration. Let's catch it and see what songs cause it. Also let's use a little bigger buffer of 6200, but I believe it doesn't fix this panic.Alexander "Arav" Andreev2025-01-05 19:05:58 +04:00
Well, still need to detect a browser, at least, just a Firefox, found a way that doesn't trigger on chromium.Alexander "Arav" Andreev2024-06-19 01:30:01 +04:00
Use writing-mode + direction instead of a deprecated appearance approach to make a range input vertical.Alexander "Arav" Andreev2024-06-19 00:10:54 +04:00
After a research on how mutexes work, a mutex bcame embedded. And locks should be invoke from outside.Alexander "Arav" Andreev2024-05-22 04:05:15 +04:00
Updated Makefile. Fixed DESTDIR, PREFIX and VERSION vars. FLAGS -> GOFLAGS. Added -linkmode and -extldflags. Also perform a build when invoke a run target if there are changes.Alexander "Arav" Andreev2024-05-22 03:43:12 +04:00
Now that only current number of listeners is being shown, send just it instead of a whole ListenerCounter.Alexander "Arav" Andreev2024-05-12 03:57:54 +04:00
Added methods for a ListenerCounter struct to access a current peak and overall numbers of listeners.Alexander "Arav" Andreev2024-05-11 04:42:06 +04:00
Updated logic in DJ handlers. Also let's give a try to not run this updating code in a PlaylistNext() handler in a separate thread. Also funnier handling of audio tag missing.Alexander "Arav" Andreev2024-05-11 04:36:23 +04:00
In ListenerCounter struct also keep track of overall number of listeners for a song and its max simultaneous number of listeners. These parameters are being reset with a Reset() method that returns its values.Alexander "Arav" Andreev2024-05-11 04:21:00 +04:00
Do not alter Song struct listeners with its methods, use a ListenerCounter to populate Listeners and MaxListeners. Eliminates the need for a mutex and SetFrom(), UpdateMaxListeners() and IncListeners() methods.Alexander "Arav" Andreev2024-05-11 04:18:28 +04:00
In an index.templ a range for was replaced by good old C-style for loop to prevent copying by value, and to get rid of that warning about mutex copy.Alexander "Arav" Andreev2024-05-10 04:59:18 +04:00
Remove an http.Error() func call from an anonym func that is spawned in a separate thread because that w (http.ResponseWriter) could be not available.Alexander "Arav" Andreev2024-05-10 04:39:56 +04:00
Jade was replaced with Templ. Also some changes were made to a layout. A ServeAsset() handler was introduced.Alexander "Arav" Andreev2024-05-10 00:11:33 +04:00
SongList struct was removed. A Song struct got UpdateMaxListeners() and IncListeners() methods. A mutex was Introduced for it. A Listeners field to store overall number of listeners during a song playing was introduced as well. A comment for the Song struct was removed.Alexander "Arav" Andreev2024-05-09 20:30:17 +04:00
A unified ServeAsset() func was introduced. AssetsGetFile() now will panic if a file doesn't exists, because it must not be the case.Alexander "Arav" Andreev2024-04-20 18:54:05 +04:00
Add 5 seconds to time.Now() to more accurately represent the time when a song actually starts to play.Alexander "Arav" Andreev2023-10-09 01:15:05 +04:00