Skip to content

Conversation

@musaprg
Copy link
Member

@musaprg musaprg commented Jun 27, 2025

Summary

  • Fixed programs current command showing Go struct internals instead of readable program data
  • Improved table formatter to handle complex nested data structures properly
  • Added custom formatting for schedule data with channel information

Key Changes

Programs Command Improvements

  • Custom Schedule Formatting: Added formatSchedulesAsTable() function that flattens nested schedule data into readable table format
  • Time Display: Added formatUnixTime() helper to convert Unix timestamps to HH:MM format for better readability
  • Description Handling: Truncate long program descriptions to 50 characters for clean table display
  • Channel Information: Include channel name and type alongside program details

Table Formatter Enhancements

  • Nested Struct Handling: Improved handling of complex data structures to show type names instead of memory addresses
  • Clean Output: Avoid displaying Go's internal struct representations in table format
  • Consistent Formatting: Ensure all data types display appropriately in table format

Testing

Tested Commands:

  • programs current - Now displays clean table with channel names, program names, times, and descriptions
  • programs search - Works correctly with improved formatting
  • channels list/show - Continues to work properly
  • recordings list/status - Functions correctly
  • JSON Output - Unchanged and works for all commands for automation scripts

Test Server: Verified against EPGStation server at http://popplio.foxhound-kelvin.ts.net:8888

Related Tasks

Addresses output formatting issues identified during comprehensive CLI testing. Maintains backward compatibility while significantly improving user experience.

Other

  • No breaking changes to API or command interface
  • JSON output preserved for automation compatibility
  • All existing flags and options continue to work

musaprg added 5 commits June 27, 2025 22:11
…a structures

- Add custom formatSchedulesAsTable function to display program schedules in readable table format
- Flatten nested schedule data to show channel name, program name, times, and descriptions
- Add formatUnixTime helper to convert timestamps to HH:MM format
- Improve table formatter to handle nested structs without showing memory addresses
- Fix programs current command to show clean, user-friendly output
- Ensure consistent formatting across all programs commands (list, current, search)
- Maintain JSON output compatibility for automation scripts

Fixes issues with programs current command showing Go struct internals instead of readable data.
Signed-off-by: Kotaro Inoue <k.musaino@gmail.com>
Signed-off-by: Kotaro Inoue <k.musaino@gmail.com>
Signed-off-by: Kotaro Inoue <k.musaino@gmail.com>
- Fix errcheck issues by properly handling resp.Body.Close() errors
- Fix unused variable 'keyword' in programs command
- Fix unnecessary type conversions for type aliases (ChannelId, Offset, Limit, Days)
- Fix goconst issue by creating outputFormatJSON constant
- Fix unchecked fmt.Fprintln error return
- Update .golangci.yml to modern configuration format with proper version
- Add comprehensive linting rules including errcheck, unused, unconvert, goconst

All golangci-lint issues resolved while maintaining functionality.
@musaprg musaprg merged commit 4e53a8c into main Jun 27, 2025
2 checks passed
@musaprg musaprg deleted the feature/fix-output-formatting branch June 27, 2025 13:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants