Commit Graph

153 Commits

Author SHA1 Message Date
Brian O'Reilly 49cba9fe7c addenda 2025-11-02 16:01:19 -05:00
Brian O'Reilly 8d0240340a typo 2025-11-02 16:01:19 -05:00
Brian O'Reilly c7852e4230 Deployment, and post deployment notes and problems in TODO.org 2025-11-02 16:01:19 -05:00
glenneth 90bb9a1650 refactor: Implement Lispy improvements - templates, strings, and error handling
This commit implements three major refactorings to make the codebase more
idiomatic and maintainable:

1. Template Path Centralization
   - Add *template-directory* parameter and helper functions
   - Replace 11+ instances of repetitive template loading boilerplate
   - New functions: template-path, load-template in template-utils.lisp

2. String Construction with FORMAT
   - Replace concatenate with format for external URLs (Icecast, static files)
   - Maintain Radiance URI handling for internal routes
   - Applied to stream URLs, status endpoints, and API responses

3. Error Handling with Custom Conditions
   - NEW FILE: conditions.lisp with comprehensive error hierarchy
   - Custom conditions: not-found-error, authentication-error,
     authorization-error, validation-error, database-error, asteroid-stream-error
   - Helper macros: with-error-handling, with-db-error-handling
   - Helper functions: signal-not-found, signal-validation-error, etc.
   - Refactored 19 API endpoints and page routes
   - Proper HTTP status codes: 404, 401, 403, 400, 500

Changes:
- conditions.lisp: NEW (180+ lines of error handling infrastructure)
- asteroid.asd: Add conditions.lisp to system components
- asteroid.lisp: Refactor 30+ endpoints, eliminate 200+ lines of boilerplate
- template-utils.lisp: Add centralized template loading helpers
- frontend-partials.lisp: Update template loading and string construction

Net result: -97 lines of code, significantly improved error handling,
more maintainable and idiomatic Common Lisp.

All changes tested and verified:
- Clean build
- All endpoints functional
- Error handling returns proper HTTP codes
- No regressions
2025-11-02 12:05:23 -05:00
Brian O'Reilly 0bb93c53a4 Update template paths in calling code. 2025-11-01 15:19:22 -04:00
Brian O'Reilly bc36a00322 Change the template extension to match clip documentation 2025-11-01 15:04:32 -04:00
Glenn Thompson 637650a5ef docs: Update PROJECT-HISTORY.org with Phase 8 and recent developments
Added Phase 8: Docker Deployment & Documentation (Oct 26 - Nov 1, 2025)
- easilok's Docker containerization work (user init, env vars, Dockerfile)
- Complete Docker deployment documentation
- Documentation updates and refinements
- Cross-distribution package manager support

Updated statistics:
- 213+ total commits (was 205+)
- 2.75 months active development (was 2.5)
- Luis Pereira (easilok) now at 23+ commits

Updated current state to November 2025:
- Complete Docker deployment for streams and application
- Comprehensive documentation overhaul
- Recent achievements section added
- Future work includes live chat and song requests per design.org

Last updated: 2025-11-01
2025-11-01 11:48:27 -04:00
Glenn Thompson fd02e4c1d1 chore: remove obsolete session notes file
SESSION-NOTES-2025-10-12.org is no longer needed
2025-11-01 11:48:27 -04:00
Glenn Thompson 1c85464a5f docs: Fix music directory location, remove Python examples, add package manager notes
- Updated DEVELOPMENT.org: music directory is now asteroid/music/ (not docker/music/)
- Clarified music/ can be a symlink to actual music collection
- Added multiple symlink options for music management
- Removed redundant Python integration examples from API-ENDPOINTS.org
- Removed duplicate Integration Examples section (curl already covered in Testing)
- Added package manager notes to INSTALLATION, DEVELOPMENT, DOCKER-STREAMING, and TESTING
- Notes clarify apt examples can be replaced with dnf, pacman, zypper, apk, etc.
- Maintains clean documentation without cluttering every command
2025-11-01 11:48:27 -04:00
Glenn Thompson f1eb43b325 docs: Comprehensive documentation update for October 2025
- Created PROJECT-HISTORY.org with complete development timeline
- Updated all documentation dates to 2025-10-26
- Added current features: multiple player modes, stream queue control, dynamic URLs
- Updated repository URLs from placeholders to actual GitHub links
- Refreshed feature lists across all docs to reflect current state
- Added PostgreSQL status (configured, ready for migration)
- Updated root README.org with comprehensive current information
- Improved quick start guides and access points
- Enhanced API documentation with complete endpoint list
- Updated all streaming documentation for Docker setup
- Standardized author attribution across all docs
- Incremented docs version to 3.0

All documentation now accurately reflects the current state of the project
with 205+ commits, 3 core contributors, and 2.5 months of active development.
2025-11-01 11:48:27 -04:00
Luis Pereira a458a85823 feat: added documentation on build and deploy docker based asteroid 2025-10-30 19:08:46 -04:00
Luis Pereira ab3acf1279 feat: add docker setup for asteroid app 2025-10-30 19:08:46 -04:00
Luis Pereira c4fd96289b feat: add custom env volume path for stream containers 2025-10-30 19:08:46 -04:00
Luis Pereira 0930fc2c1c fix: retry user initialization 2025-10-30 19:08:46 -04:00
Brian O'Reilly a2ae329d54 Merge branch 'glenneth1-fix/persistent-player-font'
conflict resolution
2025-10-25 12:36:30 -04:00
Glenn Thompson 66e97aaf37 fix: Replace Courier New with VT323 in persistent audio player frame
- Changed font-family from 'Courier New' to 'VT323' in body style
- Updated quality selector dropdown font to VT323
- Updated disable button inline style to use VT323
- Ensures consistent typography across the entire site
- Popout player already inherits VT323 from main stylesheet
2025-10-25 18:32:46 +03: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 01f5806959 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-21 21:50:39 +03:00
glenneth 74cd3625f3 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-19 13:52:59 +03: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 d0efc89e33 feat: add HTML partial hidration for now-playing 2025-10-16 19:02:00 -04:00
Luis Pereira 136fa2fa74 fix: avoid icecast xml to be shown on frontend when there is no artist 2025-10-15 06:41:07 -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 5f78213d92 Improve audio quality and streaming performance
- Add 5-second crossfades between tracks
- Use ReplayGain for consistent volume (removed normalize())
- Add audio compression to prevent clipping
- Liquidsoap watches playlist file and reloads every 5 seconds
- Fallback to random playback when queue is empty
- Fix playlist to play all tracks in order
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
glenneth b64d101f8a Add stream queue control system
- New stream-control.lisp for queue management backend
- M3U playlist generation with Docker path mapping
- API endpoints for add/remove/clear/reorder queue
- Fix library scan deduplication
- Add stream control documentation
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 91c77206d1 docs: Add session notes for page flow feature implementation
Comprehensive documentation of:
- Session objectives and accomplishments
- All files modified with detailed changes
- Technical implementation details
- Testing results
- Integration notes for team members
2025-10-12 09:47:38 -04:00
glenneth 8f1ce3f149 docs: Mark Page Flow feature as complete in TODO
Feature fully implemented and tested:
- Admin login redirects to /asteroid/admin
- Regular user login redirects to /asteroid/profile
- Front page nav links conditional on auth status and role
- Session persistence working across navigation
- User management fully functional
- Profile page API endpoints implemented
2025-10-12 09:47:38 -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
Brian O'Reilly b61e9c891a dep to run music scan in parallel. 2025-10-11 13:20:42 -04:00
Brian O'Reilly a739edc16f update TODO with some UI items. 2025-10-11 13:20:14 -04:00
glenneth 6e82688959 Update documentation authors to Asteroid Radio Development Team 2025-10-10 16:13:29 +03:00
glenneth 925a624bda Documentation cleanup: remove outdated files, add API docs, update core documentation 2025-10-10 16:13:29 +03:00
glenneth da054c1ab9 Updated changes in api-refactoring 2025-10-10 07:27:07 -04:00
glenneth e126426acd Updated TESTING.org 2025-10-10 07:27:07 -04:00
Luis Pereira 549ba8b38f feat: improved navbar in all pages 2025-10-10 07:26:39 -04:00
Luis Pereira 2b6bad3348 feat: improved nav styling 2025-10-10 07:26:39 -04:00
Brian O'Reilly dff2f52f7b Merge branch 'glenneth1-api-refactoring-only' 2025-10-10 07:24:58 -04:00
Glenn Thompson 82785e1da1 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-09 17:50:20 -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 5e33d2aafe Add comprehensive automated test suite
- Created test-server.sh with 25+ automated tests
- Tests all API endpoints, HTML pages, and static files
- Color-coded output with detailed pass/fail reporting
- Verbose mode for debugging
- Added TESTING.org documentation with usage guide
- CI/CD ready for integration into workflows

Test coverage:
- 15 API endpoints (all define-api conversions)
- 5 HTML pages (define-page)
- Static file serving
- JSON format validation
- Authentication and authorization

All tests passing except Icecast (expected - containers not running)
2025-10-08 22:56:54 -04:00