9 Commits
Author SHA1 Message Date
Tobias Gesellchen a008093775 Implement Spotify URL metadata extraction and HTML entity unescaping 2026-02-01 22:58:24 +01:00
Tobias Gesellchen d194cfd2a4 Enhance verbose mode for 'play now' command with additional API details
- Add container art URL display in verbose mode
- Show shuffle and repeat settings
- Display track ID for streaming services
- Include art image status and URL details
- Add capabilities section showing available controls (skip, favorite, seek)
- Organize verbose output in logical sections for better readability
- All additional details match those available via direct curl API calls
2026-02-01 22:42:01 +01:00
Tobias Gesellchen 2768838bad style: apply golangci-lint --fix for all remaining issues
Applied automatic fixes using golangci-lint --fix which resolved:
- All remaining wsl_v5 whitespace issues (28 issues)
- All whitespace formatting issues (1 issue)
- Improved code formatting consistency across the entire codebase

All tests passing and functionality preserved.
2026-02-01 22:11:12 +01:00
Tobias Gesellchen f8f80a5121 refactor: reduce cyclomatic complexity for all high-complexity functions
Major refactoring to improve code maintainability and readability:

- printNavigationResults: Split into multiple helper functions (16->9)
- printSearchResults: Extract song/artist/station printing functions (18->8)
- compareSourcesAndAvailability: Separate comparison logic and summary (17->7)
- storePreset: Extract parameter validation and content creation (19->8)
- getNowPlaying: Break into focused helper functions (23->5)

Benefits:
- All cyclomatic complexity issues resolved (5->0)
- Improved code readability and maintainability
- Single responsibility principle applied to helper functions
- Easier testing and debugging of individual components
- Maintained all existing functionality

Resolves all gocyclo linting issues while preserving functionality.
2026-02-01 22:10:25 +01:00
Tobias Gesellchen 63de381411 feat: show ContentItem location details for all sources in 'play now' command
- Add automatic display of ContentItem location (URI/ID) for all sources with location data
- Add --verbose flag to 'play now' command for detailed content information
- Show location details by default for any source (SPOTIFY, TUNEIN, PANDORA, STORED_MUSIC, etc.)
- Add comprehensive test coverage for content details display logic
- Add preset-store.md documentation for future /storePreset implementation
- Update documentation to reflect universal location support

This enables users to easily capture location URIs needed for the planned /storePreset feature:
- Spotify: spotify:track:123456789
- TUNEIN: /v1/playback/station/s33828
- Internet Radio: https://stream.example.com/radio
- NAS Music: 6_a2874b5d_4f83d999
- Pandora: 126740707481236361

Resolves #14 preparation work
2026-01-30 22:38:49 +01:00
Tobias Gesellchen ccd19d97a5 docs: add attribution to official Bose SoundTouch Web API documentation
- Reference original API documentation source from Bose Corporation
- Link to official Bose SoundTouch End-of-Life page
- Clarify this is an independent implementation
- Add disclaimer about non-affiliation with Bose Corporation
- Provide both online and local documentation references
2026-01-10 00:34:54 +01:00
Tobias Gesellchen 62a67818d2 Fix golangci-lint issues: resolve range copy, naming, and whitespace violations
- Fix range copy issues in cmd_network.go (use indexing instead of copying 168-byte structs)
- Rename DiscoveryService to Service to avoid package name stuttering
- Update all references to use new Service constructor names
- Apply automatic whitespace fixes using golangci-lint --fix
- Reduce linting issues from 32 to 7 (only cyclomatic complexity remains)

Remaining issues are architectural complexity violations that require manual refactoring.
2026-01-10 00:02:59 +01:00
Tobias Gesellchen 433368788b feat: complete CLI feature parity with original main.go
🎉 100% Feature Complete CLI Refactoring

MAJOR IMPROVEMENTS:
- Refactored from monolithic 149-complexity main.go to modular urfave/cli structure
- Added ALL missing commands for complete feature parity (47/47 features)
- Reduced golangci-lint issues by 70% (108+ → 32)

NEW COMMAND FILES:
- cmd_bass.go - Bass control (get/set/up/down/capabilities)
- cmd_balance.go - Balance control (get/set/left/right/center)
- cmd_clock.go - Clock management (time + display settings)
- cmd_network.go - Network information (info/ping/URL)
- cmd_zone.go - Multi-room zones (get/create/add/remove/dissolve)
- cmd_playback.go - Enhanced with key commands (volume-up/down, power, mute, etc.)
- cmd_info.go - Enhanced with preset selection and track info

COMPLETE FEATURE MAPPING:
 Discovery: discover devices [--all]
 Device Info: info, name get/set, capabilities, presets, track
 Playback: play start/pause/stop/next/prev, key send/power/mute/thumbs-up/down/volume-up/down
 Volume: volume get/set/up/down (with safety warnings, defaults: ±2)
 Bass: bass get/set/up/down/capabilities (defaults: ±1)
 Balance: balance get/set/left/right/center (defaults: ±5)
 Sources: source list/select/spotify/bluetooth/aux (with account support)
 Clock: clock get/set/now + display enable/disable/brightness/format (supports Unix timestamps, auto format)
 Network: network info/ping/url
 Zones: zone get/status/members/create/add/remove/dissolve/set
 Presets: preset selection by number (1-6)

PRESERVED FEATURES:
 All safety warnings and limits maintained
 Default increment/decrement values preserved
 Environment variable support (SOUNDTOUCH_HOST, SOUNDTOUCH_PORT)
 Extended format support (Unix timestamps, 'now', 'auto' clock format)
 Source account parameters for streaming services
 Zone deviceID@ip format support

ENHANCED USER EXPERIENCE:
 Organized subcommand hierarchy instead of 47 flat flags
 Comprehensive help system for each command
 Consistent flag naming (--host, --port, --timeout)
 Rich error messages with success/warning indicators
 Input validation and safety checks

ARCHITECTURAL IMPROVEMENTS:
 Modular command structure for better maintainability
 Shared utilities in common.go
 Consistent error handling and client configuration
 Clean separation of concerns

EXAMPLES:
# Discovery
soundtouch-cli discover devices --all --timeout 15s

# Volume control
soundtouch-cli volume set --host 192.168.1.100 --level 50
soundtouch-cli volume up --host 192.168.1.100 --amount 3

# Bass/Balance control
soundtouch-cli bass set --host 192.168.1.100 --level 3
soundtouch-cli balance left --host 192.168.1.100 --amount 5

# Key commands
soundtouch-cli key power --host 192.168.1.100
soundtouch-cli key send --host 192.168.1.100 --key SHUFFLE_ON

# Source selection
soundtouch-cli source select --host 192.168.1.100 --source SPOTIFY --account myaccount
soundtouch-cli source bluetooth --host 192.168.1.100

# Clock management
soundtouch-cli clock set --host 192.168.1.100 --time now
soundtouch-cli clock display format --host 192.168.1.100 --format 24

# Zone management
soundtouch-cli zone create --host 192.168.1.100 --members 192.168.1.101,192.168.1.102

Breaking Changes:
- CLI now uses subcommands instead of flat flags (functional equivalent provided for all commands)

RESULT: Transformed a 149-complexity monolithic CLI into a clean, organized,
feature-complete tool with 100% functionality preservation and significant UX improvements! 🚀
2026-01-09 23:54:10 +01:00
Tobias Gesellchen 97677bc8d1 feat: refactor soundtouch-cli to use urfave/cli framework
- Added urfave/cli/v2 dependency for better CLI structure
- Created modular command structure with separate files:
  - common.go: Shared utilities and client setup
  - cmd_discover.go: Device discovery commands
  - cmd_info.go: Device information commands
  - cmd_volume.go: Volume control commands
  - cmd_playback.go: Playback control commands
  - cmd_source.go: Source selection commands
- Replaced giant main() function (complexity 149) with organized subcommands
- Added proper flag handling and validation
- Improved help text and user experience

WIP: Some issues remain (flag conflicts, missing commands)
Next: Complete remaining commands and fix conflicts
2026-01-09 23:35:23 +01:00