Commit Graph

223 Commits

Author SHA1 Message Date
Glenn Thompson d540c87cfc fix: Use uri-path instead of :external representation for API detection
- Replace uri-to-url with :representation :external with uri-path
- Fixes issue where full URLs like http://asteroid.radio.localhost were generated
- .localhost domains resolve to 127.0.0.1 which breaks on remote servers
- Path-only approach works for both local and remote deployments
- Follows Radiance best practices: :external is only for redirect URLs
2025-11-20 07:14:23 +03:00
Glenn Thompson 16d81e8ccc Document frontend-partials.lisp changes in ParenScript experiment
- Added details about listener count aggregation across all mount points
- Documented stray ^ character fix
- Documented error handler additions
- Documented debug logging additions
- Cross-referenced error variable removal to Challenge 3
2025-11-20 07:13:34 +03:00
Glenn Thompson 5f77b4cd4f Complete ParenScript migration: player.js and admin.js converted
- Converted player.js to parenscript/player.lisp
- Converted admin.js to parenscript/admin.lisp
- Fixed ParenScript compilation errors (push macro, != operator, error handlers)
- Fixed now-playing display with proper Icecast stats parsing
- Aggregated listener counts across all three stream mount points (mp3, aac, low)
- Updated documentation with all lessons learned and ParenScript patterns
- All JavaScript files now successfully converted to ParenScript
- Application maintains 100% original functionality
2025-11-20 07:13:32 +03:00
Glenn Thompson d0e40cccad fix: Comment out Quicklisp check in build script and update ParenScript docs
- Allow building when Quicklisp is already loaded
- Update ParenScript resources with correct GitLab repository URL
2025-11-20 07:07:57 +03:00
glenneth 263dc8a800 docs: Update ParenScript experiment with profile.js and users.js lessons
Added documentation for the two latest conversions:
- Marked profile.js and users.js as complete
- Documented modulo operator issue (use 'rem' not '%')
- Documented property access with hyphens (use ps:getprop)
- Documented HTML generation patterns
- Documented conditional attributes in templates
- Added comprehensive summary of 10 key ParenScript patterns

Status: 4 of 6 JavaScript files successfully converted
Remaining: admin.js, player.js (complex, 610 lines)
2025-11-20 07:07:27 +03:00
glenneth 022b1d8b96 feat: Convert users.js to ParenScript
Successfully converted users.js with all functionality:
- User stats display (total, active, admin, DJ counts)
- Load users list with table display
- Change user role (UI working, backend may need fixes)
- Activate/deactivate users
- Create new user form
- Auto-refresh stats every 30 seconds

Generated JavaScript working correctly.

Files:
- parenscript/users.lisp - ParenScript source
- asteroid.asd - Added users to parenscript module
- asteroid.lisp - Added users.js to static route interception
- static/js/users.js - Removed from git (backed up as .original)

Four files successfully converted to ParenScript!
Remaining: admin.js, player.js
2025-11-20 07:07:27 +03:00
glenneth cc79ba7330 feat: Convert profile.js to ParenScript
Successfully converted profile.js with all functionality:
- Profile data loading (username, role, join date, last active)
- Listening statistics display
- Recent tracks display
- Top artists display
- Password change form
- Export listening data
- Clear listening history
- Toast notifications

Generated JavaScript working correctly after fixing modulo operator.

Key learning: Use 'rem' instead of '%' for modulo in ParenScript.

Files:
- parenscript/profile.lisp - ParenScript source
- asteroid.asd - Added profile to parenscript module
- asteroid.lisp - Added profile.js to static route interception
- static/js/profile.js - Removed from git (backed up as .original)
- static/js/player.js - Restored (skipped for now, too complex)

Three files successfully converted to ParenScript\!
2025-11-20 07:07:27 +03:00
glenneth 3d7b08119a docs: Update ParenScript experiment documentation
Moved PARENSCRIPT-EXPERIMENT.org to docs/ directory.

Updates:
- Marked front-page.js as complete in Phase 2
- Removed duplicate front-page.js from Phase 3
- Added conversion progress section with both files
- Documented front-page.js specific patterns:
  * Global variables with defvar
  * String concatenation with +
  * Conditional logic with cond
  * Object property access with ps:getprop
- Listed all tested features for front-page.js

Status: 2 of 6 JavaScript files converted successfully
2025-11-20 07:07:27 +03:00
glenneth c35ae5a1f0 feat: Convert front-page.js to ParenScript
Successfully converted front-page.js with all functionality:
- Stream quality configuration and switching
- Now playing updates (every 10 seconds)
- Pop-out player functionality
- Frameset mode toggle
- Auto-reconnect on stream errors

Generated JavaScript: 6900 characters
No browser errors, all features working

Files:
- parenscript/front-page.lisp - ParenScript source
- asteroid.asd - Added front-page to parenscript module
- asteroid.lisp - Added front-page.js to static route interception
- static/js/front-page.js - Removed from git (backed up as .original)

Two files successfully converted to ParenScript!
2025-11-20 07:07:27 +03:00
glenneth 0d50f01a07 fix: Replace async/await with promise chains in ParenScript
ParenScript doesn't support async/await syntax properly. Changed to use
promise chains with .then() which compiles correctly.

Result:
- No JavaScript errors
- Auth UI working correctly
- Generated JS: 1386 characters
- First successful ParenScript replacement complete\!

Next: Can convert more JS files (profile.js, users.js, etc.)
2025-11-20 07:07:27 +03:00
glenneth 3c2ddf84c0 fix: ParenScript compilation working - intercept static route
The issue was route ordering. Since Radiance matches routes in load order,
we couldn't override the static file route. Solution: intercept the static
route and check if path is 'js/auth-ui.js', then serve ParenScript-compiled
JavaScript instead.

Changes:
- Compile ParenScript to string at load time (stored in *auth-ui-js*)
- Intercept static route to serve ParenScript for auth-ui.js
- JavaScript successfully generated (1290 chars)
- Ready for browser testing
2025-11-20 07:07:27 +03:00
glenneth b12e366d2c fix: Move ParenScript route before static file route
The ParenScript route must come before the catch-all static route
to properly override /static/js/auth-ui.js with dynamically compiled
JavaScript. Routes are matched in order, so specific routes must
precede general patterns.
2025-11-20 07:07:27 +03:00
glenneth 3c76436e81 fix: Correct parenthesis count in auth-ui ParenScript
Removed extra closing parenthesis that was causing compilation error.
Build now succeeds with ParenScript version of auth-ui.js
2025-11-20 07:07:27 +03:00
glenneth 8b839daf0a experiment: Replace auth-ui.js with ParenScript version
- Removed static/js/auth-ui.js (backed up as .original)
- Templates still reference /asteroid/static/js/auth-ui.js
- Route now serves dynamically compiled ParenScript
- Ready to test ParenScript replacement
2025-11-20 07:07:27 +03:00
glenneth ec00843a90 experiment: Convert auth-ui.js to ParenScript
- Created parenscript/auth-ui.lisp with ParenScript version
- Added route to serve compiled JavaScript at /static/js/auth-ui.js
- Updated asteroid.asd to include parenscript module
- First conversion: auth-ui.js (authentication UI state management)

The ParenScript code compiles to equivalent JavaScript and is served
dynamically. This allows us to write client-side code in Lisp.
2025-11-20 07:07:27 +03:00
glenneth aa4ed06d7f experiment: Add ParenScript setup and utilities
- Add parenscript dependency to asteroid.asd
- Create parenscript-utils.lisp with helper functions and macros
- Add PARENSCRIPT-EXPERIMENT.org documenting the conversion plan
- Goal: Replace all JavaScript with ParenScript for full-stack Lisp
2025-11-20 07:07:24 +03:00
Glenn Thompson cec3763403 Merge remote-tracking branch 'upstream/main' 2025-11-20 07:04:29 +03:00
Luis Pereira a1cfaf468c fix: playlist creation on frontend 2025-11-19 18:00:02 -05:00
Luis Pereira 9c3d4bcec4 fix: hide duplicated browser audio in player page 2025-11-19 18:00:02 -05:00
Luis Pereira a1fa5b0b51 fix: tracks and playlist db interation through data-model 2025-11-19 18:00:02 -05:00
Glenn Thompson c198775083 Merge remote-tracking branch 'upstream/main' 2025-11-18 07:15:32 +03:00
Luis Pereira 559187df2e fix: with-error-handling using inner message
This fix some issues where, on the client, `response.message` was `Ok.`
for error responses and real error message needed to be extracted from
`response.data.message`, which made a weird API.
2025-11-17 18:08:12 -05:00
Luis Pereira 59076e67b8 fix: profile password change using non existing function 2025-11-17 18:08:12 -05:00
Glenn Thompson 2a505e482d Fix scan-library path to work in both development and production
- Auto-detect music library path based on environment
- Check for music/library/ directory for local development
- Default to /app/music/ for production Docker deployment
- Allow MUSIC_LIBRARY_PATH environment variable override
- Fixes scan-library function failing on production server
2025-11-17 18:06:14 -05:00
Glenn Thompson 19b9deccf5 fix: Use /app/music/ as default music library path for production
- Changed hardcoded music/library/ path to /app/music/ (production path)
- Added MUSIC_LIBRARY_PATH environment variable for local dev override
- Fixes scan library function on production server
- Aligns with path structure used in M3U playlists and liquidsoap config
2025-11-17 18:06:14 -05:00
Glenn Thompson d187a01641 Merge remote-tracking branch 'upstream/main' 2025-11-17 06:34:49 +03:00
Brian O'Reilly 6043e3f9a4 lets just ignore the library directory, permanently. :(( 2025-11-16 11:16:01 -05:00
Luis Pereira 8245917b28 fix: add data-model-save wrapper
This tries to bypass a weird error where native "dm:save" fails with lambdalite.
2025-11-16 09:38:04 -05:00
Luis Pereira 74088ca47b fix: admin button shown only for admin accounts 2025-11-16 09:38:04 -05:00
Luis Pereira c5804641b8 fix: move user database methods to data-model 2025-11-16 09:38:04 -05:00
Luis Pereira 92ccee7cf6 feat: data module to alist converter 2025-11-16 09:38:04 -05:00
Glenn Thompson f498008d2a Merge remote-tracking branch 'upstream/main' 2025-11-15 18:43:48 +03:00
Luis Pereira 8b33968011 fix: failed register error messages 2025-11-15 08:23:31 -05:00
Luis Pereira 6f3973e86a fix: invalid login error on template 2025-11-15 08:23:31 -05:00
Luis Pereira 355655e8eb fix: styling of audio player on chrome browsers 2025-11-15 08:21:10 -05:00
Glenn Thompson 8b0e494da9 fix: Replace undefined uri-path with radiance:path
The previous commit used uri-path() which doesn't exist in Radiance.
This caused 'The function ASTEROID::URI-PATH is undefined' errors
when trying to authenticate.

Changed to use radiance:path() which is the correct Radiance API
function for extracting the path component from a URI object.

Fixes authentication in both require-authentication and require-role.
2025-11-14 06:57:42 -05:00
Glenn Thompson 96a3ce2b64 Merge remote-tracking branch 'upstream/main' 2025-11-14 09:08:31 +03:00
Glenn Thompson 8c5cb6be31 fix: Use sequential mode in liquidsoap to play through entire playlist
The playlist was stuck on the first track because mode='normal' stops
after playing once. Changed to mode='sequential' which plays through
the entire playlist in order and then loops.

Also improved reload mechanism:
- Use reload_mode='watch' for efficient file change detection
- Increased reload interval to 5 minutes (less disruptive)
2025-11-13 17:30:19 -05:00
Glenn Thompson 63d606b39b fix: Use sequential mode in liquidsoap to play through entire playlist
The playlist was stuck on the first track because mode='normal' stops
after playing once. Changed to mode='sequential' which plays through
the entire playlist in order and then loops.

Also improved reload mechanism:
- Use reload_mode='watch' for efficient file change detection
- Increased reload interval to 5 minutes (less disruptive)
2025-11-13 07:08:25 +03:00
Brian O'Reilly 0204485407 ... but, you know, with actually correct paths. 2025-11-12 20:44:04 -05:00
Brian O'Reilly 0d68c9cc82 build info updates, curated playlist 2025-11-11 17:12:32 -05:00
Brian O'Reilly 7c569ca4f6 startup toggles 2025-11-11 12:04:06 -05:00
Brian O'Reilly f0b03255b8 but not postgres yet. 2025-11-11 11:26:05 -05:00
Brian O'Reilly c4a030e6e6 building building.. 2025-11-11 11:19:03 -05:00
Brian O'Reilly 5f91a81545 move main closer to my config branch in preperation for moving in totality. 2025-11-11 11:16:32 -05:00
Brian O'Reilly 7ed4515139 a nice asteroid, from Summer Emacs. remember to ask for forgiveness. 2025-11-11 11:11:50 -05:00
Brian O'Reilly 87e3f98e17 fixup routes. turn down compression on executable. 2025-11-11 11:06:29 -05:00
Brian O'Reilly 11c3e1df77 slight error computing the external/internal url from the uri object. 2025-11-10 08:10:53 -05:00
Luis Pereira 2fa72117cd Partial Revert "refactor: Implement Lispy improvements - templates, strings, and error handling"
This reverts commit 5882141cfa.
2025-11-08 08:55:27 -05:00
glenneth d9f2ac58fc fix: Replace l:info with format t for logging
- l:info was called with wrong number of arguments
- Use format t for consistency with rest of codebase
2025-11-06 16:47:18 -05:00