Commit Graph

231 Commits

Author SHA1 Message Date
Brian O'Reilly 6c2ed75b15 include i-postgmodern interface for postgres.
Conflicts:
	asteroid.asd
2025-12-07 19:44:04 -05:00
Brian O'Reilly d2508451d0 Delete the music/library directory which held an erroneous path to a softlink that doesn't exist in prod. 2025-12-07 19:44:04 -05:00
Glenn Thompson efe993e0c1 Fix HTML entity decoding in now playing titles
- Use plump:decode-entities to decode HTML entities (&, ", etc.) in track titles from Icecast XML
- Fixes display of artist names and track titles containing ampersands and other special characters
- One-line fix using existing plump library dependency
2025-12-06 11:55:24 -05:00
Glenn Thompson 2fa03e447a Update dropdown colors to match spectrum analyzer theme
- Dropdown boxes now dynamically update their text and border colors to match selected theme
- Prevents color clashing between UI elements and spectrum analyzer
- Colors update both on theme change and on page load
2025-12-06 11:55:24 -05:00
Glenn Thompson c08b5f73de Add monotone theme and dynamic border color
- Add monotone theme with deep blue to cobalt gradient
- Update canvas border color dynamically to match selected theme
- Set initial border color on page load based on saved preference
2025-12-06 11:55:24 -05:00
Glenn Thompson 16a69dc6e9 Rename recently-played.js to recently-played.js.original
Match naming convention of other original JS files now replaced by parenscript
2025-12-06 11:55:24 -05:00
Glenn Thompson 51387bddba Add spectrum analyzer theming and visualization styles
- Add 6 color themes: green, blue, purple, red, amber, rainbow
- Add 3 visualization styles: bars, wave, dots
- Add UI controls (dropdowns) to change theme and style
- Persist user preferences in localStorage
- Remove debug logging from parenscript serving and Icecast stats
- Fix dots visualization with proper Math.PI handling
2025-12-06 11:55:24 -05:00
Glenn Thompson b6be0ebab1 feat: Convert JavaScript to Parenscript with stream fixes and UX improvements
Major Changes:
- Convert all JavaScript files to Parenscript for better maintainability
- Move spectrum-analyzer to parenscript/ directory structure
- Add parenscript-utils.lisp for shared utilities
- Convert admin.js, player.js, front-page.js, auth-ui.js to Parenscript
- Convert profile.js, users.js, recently-played.js to Parenscript

Stream Reconnect Fixes (from merged PR):
- Add reset-spectrum-analyzer function to properly clean up Web Audio API
- Implement reconnect logic for pauses longer than 10 seconds
- Detect stale audio in 'playing' event and force stream reconnection
- Prevent 'Now Playing' updates while stream is paused
- Reduce reconnect delay to 200ms for faster response
- Add proper spectrum analyzer reset/reinit during reconnection

UX Improvements:
- Change live indicator from blink to smooth pulse (2s ease-in-out)
- Pulse animation like old PowerBook/MacBook sleep indicator
- Add MUTED indicator to spectrum analyzer when audio is muted
- Spectrum continues to flow even when muted (data still streaming)
- Red 'MUTED' text displayed in top-right corner of canvas

Technical Details:
- Parenscript files generate JavaScript via API endpoints
- All player modes updated: main player, front page, popout, frame player
- Improved audio context handling to only create once per element
- Added comprehensive error handling and logging
- Updated asteroid.asd to include parenscript module structure

Documentation:
- Updated all documentation dates to 2025-12-06
- Added PARENSCRIPT-EXPERIMENT.org documenting the conversion
- Updated PROJECT-HISTORY.org with Phase 9 (Visual Audio Features)
- Added comprehensive project statistics (408 commits, 9,300 LOC)

This conversion improves code maintainability by using Lisp throughout
the stack and makes it easier to share code between frontend and backend.
2025-12-06 11:55:24 -05:00
Brian O'Reilly f68c85f0cd asteroid.css is generated on every start. delete it from repository. 2025-12-06 10:25:26 -05:00
Glenn Thompson 4ec90c0f27 perf: Reduce reconnect delay from 500ms to 200ms for faster response
Optimized the timeout after stream reconnection to make the pause/unpause
experience more responsive. The 200ms delay is sufficient for the browser
to clear buffers and start the fresh stream while minimizing perceived lag.
2025-12-06 08:36:30 -05:00
Glenn Thompson 7c7b2c921e fix: Prevent stale audio playback after long pause and reorganize spectrum analyzer
- Detect pauses longer than 10 seconds across all player modes
- Intercept 'playing' event to stop stale buffered audio
- Force stream reconnect to get live audio after long pause
- Reset and reinitialize spectrum analyzer during reconnect
- Prevent 'Now Playing' updates while stream is paused
- Move spectrum-analyzer.lisp to parenscript/ directory
- Update all documentation dates to 2025-12-06
- Add comprehensive project statistics (408 commits, 9,300 LOC)
- Add Phase 9 (Visual Audio Features) to project history

Fixes issue where resuming playback after a long pause would play
old buffered audio instead of the current live stream. The fix uses
the 'playing' event to detect when stale audio starts and immediately
stops it, then reconnects to get fresh stream data.

All player modes updated: main player, front page, popout, and frame player.
2025-12-06 08:36:30 -05:00
Glenn Thompson 6e8260172f fix: Reduce Icecast burst size and prevent now-playing updates during pause
- Reduced Icecast burst-size from 64KB to 8KB to minimize buffer accumulation
- Fixed spectrum analyzer to only create MediaElementSource once
- Added resetSpectrumAnalyzer() function to allow reconnection
- Prevent now-playing info updates when stream is paused across all players:
  * Player page
  * Front page
  * Pop-out player
  * Frame player
  * Admin page
- After pause >10s, reconnect stream and reinitialize spectrum analyzer
- Preserves spectrum analyzer functionality after pause/unpause
- Eliminates stuttering and buffer accumulation issues
2025-12-06 08:36:30 -05:00
Glenn Thompson 924f6498de Add real-time spectrum analyzer using Parenscript
- Implement Web Audio API-based spectrum analyzer with green gradient bars
- Add spectrum analyzer to front page and persistent player content frames
- Support cross-frame audio element access for frameset mode
- Add CORS headers to Icecast configuration for Web Audio API
- Serve Parenscript-generated JavaScript dynamically via API endpoint
- Canvas visualization appears below page title, above navigation
2025-12-03 19:00:13 -05:00
Glenn Thompson 090e8e9898 fix: Serve spectrum analyzer JavaScript dynamically via API
Changed from static file generation to Radiance API endpoint.
Parenscript now generates JavaScript in-memory at runtime when
the /api/asteroid/spectrum-analyzer.js endpoint is requested.

This is the correct approach for Parenscript integration with Radiance.
2025-12-03 19:00:13 -05:00
Glenn Thompson a1257af16f feat: Add spectrum analyzer using Parenscript
Implements real-time audio visualization for the main page:
- Added Parenscript dependency to asteroid.asd
- Created spectrum-analyzer.lisp with Parenscript code
- Added canvas element to front-page.ctml above nav buttons
- Auto-generates JavaScript at compile time
- Green gradient bars matching Asteroid aesthetic
- Uses Web Audio API for FFT analysis

This is the first Parenscript component in Asteroid Radio,
demonstrating the approach for future JavaScript conversions.
2025-12-03 19:00:13 -05:00
Glenn Thompson 280b8f0690 fix: Use 'normal' mode instead of 'sequential' for playlist playback
The 'sequential' mode in Liquidsoap starts playback at a random position
in the playlist, causing tracks to play out of order. Switching to 'normal'
mode ensures the playlist starts from the beginning and plays sequentially
through all tracks in order.
2025-12-03 19:00:13 -05:00
Glenn Thompson c668a5f40f Add phase metadata to stream-queue.m3u 2025-12-03 19:00:13 -05:00
Luis Pereira 4c534a0a4f feat: add blinking live cursor 2025-11-23 18:43:45 -05:00
Luis Pereira 709affa957 fix: improve live stream text proportions 2025-11-23 18:43:45 -05:00
Glenn Thompson 57af5663ab style: Match audio player color to app panels
- Change audio player background from #1a1a1a to #1a2332
- Matches the blue-grey color used throughout the app
- Addresses Fade's feedback about brownish grey appearance
2025-11-22 09:06:05 -05:00
Glenn Thompson 9a7b5eb50f style: Update recently played track styling
- Change track link colors: cyan default, green hover, blue visited
- Add equal left/right padding (12px) to track-list for centered separators
- Increase track-item top/bottom padding from 6px to 10px for better spacing
- Move track-list and track-item inside recently-played-list block for proper CSS nesting
- Addresses feedback from easilok on symmetry and breathing room
2025-11-22 09:06:05 -05:00
Glenn Thompson 2fae9f80f4 fix: Correct LASS hover syntax for track links
- Move track-link styles inside recently-played-list block for proper CSS nesting
- Use (:and .track-link :hover) at correct nesting level per LASS documentation
- Fixes hover color change to green when mousing over track names
- Generates correct CSS selector: .recently-played-list .track-link:hover
2025-11-22 09:06:05 -05:00
Glenn Thompson ea3cd4a8f6 refactor: Make track name clickable with external link icon
- Replace separate MusicBrainz link with clickable track name
- Add external link icon next to track name
- Simplify grid layout by removing track-meta column
- Update CSS styling for track-link with hover effects
- Improves UX by making the primary action (clicking track) more intuitive
2025-11-22 09:06:05 -05:00
Glenn Thompson 6bf19ade01 Add recently played tracks feature with MusicBrainz integration
- Display last 3 played tracks on front page
- Auto-updates every 30 seconds
- Shows track title, artist, and time ago
- Links to MusicBrainz search for each track
- Thread-safe in-memory storage
- Works in both normal and frameset modes
- Hacker-themed green styling

Implements feature request from fade to show recently played tracks
with linkage to track info at music database.
2025-11-22 09:06:05 -05:00
Luis Pereira 34ca61809b feat: add user role update routes 2025-11-21 18:06:49 -05:00
Luis Pereira ded376d971 feat: add user activate and deactivate routes 2025-11-21 18:06:49 -05:00
Glenn Thompson 66d013d7d1 feat: Add recently-played.ctml partial template
Add modular partial template for recently-played section that can be included in other templates
2025-11-20 17:05:35 -05:00
Glenn Thompson 3a08ff61c0 feat: Add favicon and asteroid.png graphics to front page
- Add favicon.ico, favicon-16x16.png, and favicon-32x32.png
- Add asteroid.png graphic to header on both front-page.ctml and front-page-content.ctml
- Update header styling to display asteroid graphics flanking the station name
2025-11-20 17:05:35 -05:00
Glenn Thompson 79ab87436e Refine recently played styling and MusicBrainz search
- Use 2-column grid layout: track/artist left, time/link right
- Match color scheme with now-playing section (blue text)
- Tighter row spacing (6px padding)
- Simplified MusicBrainz search query (no field prefixes)
- Fix CSS selector for proper link styling
- Right-align time and MusicBrainz link
2025-11-20 17:05:35 -05:00
Glenn Thompson 0a7d5c3de5 Add recently played tracks feature with MusicBrainz integration
- Display last 3 played tracks on front page
- Auto-updates every 30 seconds
- Shows track title, artist, and time ago
- Links to MusicBrainz search for each track
- Thread-safe in-memory storage
- Works in both normal and frameset modes
- Hacker-themed green styling

Implements feature request from fade to show recently played tracks
with linkage to track info at music database.
2025-11-20 17:05:35 -05: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
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
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
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 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
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