Commit Graph

66 Commits

Author SHA1 Message Date
Glenn Thompson 86536a2f22 Replace reconnect button emoji with sync icon
- Add static/icons/sync.png (24x24px)
- Use CSS filter to make icon green to match player theme
2025-12-12 08:57:07 -05:00
Glenn Thompson c89e31b998 Add geo stats collection and improve admin dashboard UI
- Add geo IP lookup for listener locations (ip-api.com)
- Add geo stats table with country flags to admin dashboard
- Fix listener stats table alignment with proper centering
- Fix Now Playing display to update without requiring audio playback
- Add caching for geo lookups to reduce API calls
2025-12-10 11:11:32 -05:00
Glenn Thompson 4be3b83da1 Add listener statistics feature
- Add database schema for listener snapshots, sessions, and aggregates
- Implement background polling of Icecast admin XML stats
- Add API endpoints for current, daily, and geo stats
- Add listener stats section to admin dashboard with auto-refresh
- GDPR compliant: IP hashing, data retention cleanup
2025-12-10 11:11:32 -05:00
Glenn Thompson 8c19e0fbde Fix wedged player with reconnect button and volume preservation
- Add reconnect button (🔄) to frameset player bar
- Recreate audio element on reconnect to fix wedged MediaElementSource
- Properly close and reinitialize AudioContext for spectrum analyzer
- Preserve volume and muted state when reconnecting
- Show status messages for connection issues
- Reduce Now Playing update interval to 5 seconds
- Add front-page.js to player-content.ctml for Now Playing updates
- Create About pages (about.ctml and about-content.ctml)
- Add About link to navigation in both modes
2025-12-10 11:11:32 -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 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 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
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 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 355655e8eb fix: styling of audio player on chrome browsers 2025-11-15 08:21:10 -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
Luis Pereira 62cad7b2ad fix: move duplicated stream information to live stream panel 2025-11-06 16:42:29 -05:00
glenneth 4c99ded7f0 feat: Add password management and fix listener count
- Add user password change functionality in profile page
- Add admin password reset functionality in admin dashboard
- Fix listener count to show total from Icecast root tag
- Replace concatenate with format
- Add with-error-handling to API endpoints
- Make Icecast port binding configurable via ICECAST_BIND env var
- Add comprehensive docstrings to public functions

Note: Password reset has known issue with LambdaLite db:update
not updating password-hash field. Issue reported as an issue.
2025-11-04 16:26:29 -05:00
Luis Pereira 4404b416eb fix: stream information update on frameset view 2025-11-03 18:36:40 -05:00
Luis Pereira aa9a2cf225 feat: persist stream quality in local storage 2025-11-03 18:36:40 -05:00
Luis Pereira 559893ed64 fix: redirection when navigating between frameset 2025-11-03 18:36:40 -05:00
glenneth a795680e99 feat: Add hybrid player with frameset and pop-out options
- Add frameset mode with persistent audio player in bottom frame
- Add localStorage preference system for user choice
- Update all page navigation to work in both regular and frameset modes
- Add enable/disable buttons for frameset mode
- Fix redirect loops and template parameter issues
2025-10-22 18:01:48 -04:00
glenneth d8abd9661d feat: Add pop-out player and queue management improvements
- Add pop-out player window (400x300px) with auto-reconnect on stream errors
- Add queue reordering with up/down buttons in admin panel
- Add 'Load Queue from M3U' functionality
- Remove Play/Stream buttons from track management
- Fix Liquidsoap audio quality issues:
  - Remove ReplayGain and compression to prevent pulsing
  - Change reload_mode to 'seconds' to prevent playlist exhaustion
  - Reduce crossfade to 3 seconds
  - Add audio buffering settings for stability
- Add auto-reconnect logic for both front page and pop-out players
2025-10-22 18:01:48 -04:00
glenneth 9721fbbc8a fix: track search missing query variable
- Add missing query variable in filterTracks() function
- Reads value from track-search input field
- Bug was pre-existing, not introduced by refactoring
2025-10-17 21:38:18 -04:00
glenneth b3fd00cb4d refactor: improve code consistency and maintainability
- Add /api/asteroid/partial/now-playing-inline endpoint for inline text
- Refactor admin.js to use server-side partial (removes 23 lines of JSON/XML parsing)
- Fix hardcoded path in convert-to-docker-path to use *music-library-path* variable
- Consistent with front-page and player refactoring from upstream
- Improves portability and reduces client-side JavaScript complexity
2025-10-17 21:38:18 -04:00
Luis Pereira 4d0b54f7d6 feat: move player to use now-playing partial 2025-10-16 19:02:00 -04:00
Luis Pereira f3d012cbc6 feat: move front-page to use now-playing partial 2025-10-16 19:02:00 -04:00
Luis Pereira 6506f7d153 fix: playlist create button wrap on small screens 2025-10-15 06:40:20 -04:00
Luis Pereira a7fe6a73c7 fix: srollbars only visible when required on chrome browsers 2025-10-15 06:40:20 -04:00
glenneth fd7707eb74 Improve player UI and reduce buffering
- Remove aggressive stream reconnect
- Reduce live stream buffering delay
- Clean up debug logging
- Fix playlist loading errors
2025-10-15 06:38:53 -04:00
glenneth d4edb8bfec Add admin UI for stream queue management
- Queue management section with add/remove/clear controls
- Add to Queue button on each track in library browser
- Search tracks and add to queue
- Add 10 random tracks button
- Live stream monitor with Now Playing display
- Toast notifications for user feedback
- Real-time queue updates
2025-10-15 06:38:53 -04:00
Luis Pereira 70263fbfbc feat: stream base url as variable on templates 2025-10-12 09:56:08 -04:00
glenneth 5362c86f9f fix: Complete UI fixes for page flow feature
- Fix api-output wrapper handling in all JavaScript files
- Add profile page API endpoints (profile, listening-stats, recent-tracks, top-artists)
- Fix session persistence - auth-ui.js now correctly detects login status
- Fix user stats display - now shows correct counts (3 users, 1 admin)
- Fix View All Users table - properly displays all users
- Handle empty arrays gracefully in profile.js (no errors for missing data)

All UI issues resolved:
✓ User management page fully functional
✓ Session persists across navigation
✓ Profile page loads without errors
✓ Correct nav links shown based on role
✓ Admin sees Admin link, regular users don't
2025-10-12 09:47:38 -04:00
glenneth 4b8a3a064c feat: Implement role-based page flow and user management APIs
Core Features:
- Login redirects based on user role (admin -> /admin, users -> /profile)
- User registration redirects to /profile page
- Convert user management APIs to use define-api (Radiance standard)
- Add user statistics API endpoint
- Add create user API endpoint
- Add list users API endpoint

Authentication & Authorization:
- Update require-role to return proper JSON for API requests
- Fix password verification with debug logging
- Add reset-user-password function for admin use

API Endpoints (using define-api):
- /api/asteroid/users - Get all users (admin only)
- /api/asteroid/user-stats - Get user statistics (admin only)
- /api/asteroid/users/create - Create new user (admin only)

Bug Fixes:
- Fix JavaScript API path for user-stats endpoint
- Remove dependency on non-existent radiance:api-output
- Use api-output for proper JSON responses

Testing:
- Admin login redirects to /asteroid/admin ✓
- Regular user login redirects to /asteroid/profile ✓
- User creation working (testuser created successfully) ✓
- User statistics loading correctly ✓

Known Issues (non-blocking):
- User table display needs UI fixes
- Profile page needs additional API endpoints
- Session persistence on navigation needs investigation
2025-10-12 09:47:38 -04:00
Brian O'Reilly 26c516c25d this is kind of a dead patch. clean up working set. 2025-10-11 13:21:38 -04:00
Luis Pereira 2b6bad3348 feat: improved nav styling 2025-10-10 07:26:39 -04:00
Glenn Thompson 5bc6f27840 Fix frontend JavaScript to work with define-api endpoints
- Update API paths from /asteroid/api/ to /api/asteroid/ in users.js and profile.js
- Add RADIANCE API wrapper handling for icecast-status responses
- Improve error handling in player.js loadTracks function
- All frontend code now properly handles define-api response format
2025-10-08 22:56:54 -04:00
glenneth e0c1eac408 Refactor API endpoints to use Radiance's define-api macro
- Converted 15 API endpoints from define-page to define-api
- Added JSON API format configuration for proper JSON responses
- Updated all frontend JavaScript files to use new API URLs
- Maintained define-page for HTML pages and static file serving
- Added comprehensive documentation of changes

Benefits:
- Framework compliance with Radiance best practices
- Automatic routing at /api/asteroid/<name>
- Clean lambda-list parameter handling
- Built-in browser/API dual usage support
- Proper HTTP status codes for errors

All API endpoints tested and working correctly.
2025-10-08 22:56:54 -04:00
glenneth efb96f950e Fix auth form styling: wider forms (600px) and hidden message boxes
- Increased auth-form max-width from 400px to 600px to match site styling
- Reduced form-group margin-bottom from 3rem to 1.5rem for better spacing
- Added display:none to error/success message boxes by default
- Message boxes now only show when server sets display-error/display-success
2025-10-07 18:39:49 -04:00
glenneth 5d31763e85 Add user registration and authentication UI improvements
- Add registration page with form validation
- Add login/register/logout navigation with conditional display
- Add auth-status API endpoint for session checking
- Add auth-ui.js for dynamic nav based on login state
- Update navigation across all pages (front, admin, profile, player)
- Style logout button with subtle red color
- Auto-login after successful registration
2025-10-07 18:39:49 -04:00