Skip to content

Conversation

@musaprg
Copy link
Member

@musaprg musaprg commented Jun 28, 2025

Summary

This PR implements comprehensive reserves and encodes subcommand functionality for epgstationctl, providing full access to EPGStation's reservation management and encoding operations through the command line interface.

✅ Reserves Command (epgstationctl reserves)

  • list: List reservations with filtering by type, rule ID, pagination support
  • show: Display detailed reservation information for specific reservations
  • create: Create new manual reservations with encoding options
  • update: Update existing reservation settings (encoding modes, directories, etc.)
  • delete: Delete reservations
  • unskip: Remove skip status from reservations
  • remove-overlap: Remove overlap status from reservations
  • status: Show reservation status summary and counts by category
  • update-system: Trigger reservation system update

✅ Encodes Command (epgstationctl encodes)

  • list: List running and queued encoding jobs with progress information
  • add: Add new manual encoding jobs for recorded content with comprehensive options
  • cancel: Cancel active or queued encoding jobs
  • status: Show encoding system status with job counts

🔧 Technical Implementation

  • Extended Client Wrapper: Added 15 new wrapper methods for comprehensive API coverage
    • All reserves endpoints: list, show, create, update, delete, unskip, remove-overlap, status, update-system
    • All encodes endpoints: list, add, cancel, status
  • Type-Safe Integration: Full compatibility with EPGStation's generated API client
  • Consistent CLI Patterns: Follows existing command structure and conventions
  • Output Format Support: Both table and JSON output formats for all commands
  • Comprehensive Error Handling: Proper error handling and user feedback
  • Extensive Flag Support: All API parameters exposed as CLI flags

📚 Documentation

  • Updated README.md with comprehensive usage examples for both command sets
  • Added feature descriptions for reservation and encoding management
  • Updated project structure documentation
  • Includes practical examples for common use cases

Test plan

  • All commands compile successfully
  • Help documentation generates correctly for all subcommands
  • Command registration works properly (both commands appear in main help)
  • Flags are properly configured and documented
  • Code follows existing patterns and conventions
  • API integration uses correct types and endpoints
  • Error handling matches existing command patterns

Related Tasks

Implements the complete reserves and encodes functionality as requested, providing:

  • Full reservation lifecycle management
  • Complete encoding job control
  • Consistent CLI experience
  • Comprehensive API coverage

Other

This implementation provides the foundation for complete EPGStation management through the CLI, significantly expanding the tool's capabilities beyond the existing channels, programs, recordings, and rules commands.

Add comprehensive reservation and encoding management functionality:

- feat(reserves): implement complete reservation management
  - List reservations with filtering by type, rule ID, pagination
  - Show detailed reservation information
  - Create, update, and delete reservations
  - Handle reservation conflicts, skips, and overlaps
  - Display reservation status summaries and counts
  - Trigger reservation system updates

- feat(encodes): implement encoding job management
  - List running and queued encoding jobs with progress
  - Add new manual encoding jobs for recorded content
  - Cancel active or queued encoding jobs
  - Show encoding system status

- feat(client): extend wrapper with reserves and encodes API methods
  - Add comprehensive wrapper methods for all reserves endpoints
  - Add encoding job management methods
  - Maintain consistent error handling and response processing

- docs(readme): update documentation with new commands
  - Add reservation and encoding management feature descriptions
  - Include comprehensive usage examples for all subcommands
  - Update project structure documentation

All commands follow existing CLI patterns and support both table and JSON output formats.
addCmd.Flags().BoolVar(&saveSameDirectory, "save-same-dir", false, "Save in same directory as original")

// Mark required flags
addCmd.MarkFlagRequired("recorded-id")

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 [golangci] reported by reviewdog 🐶
Error return value of addCmd.MarkFlagRequired is not checked (errcheck)


// Mark required flags
addCmd.MarkFlagRequired("recorded-id")
addCmd.MarkFlagRequired("mode")

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 [golangci] reported by reviewdog 🐶
Error return value of addCmd.MarkFlagRequired is not checked (errcheck)


var formatter output.Formatter
switch cfg.Output.Format {
case "json":

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 [golangci] reported by reviewdog 🐶
string json has 3 occurrences, make it a constant (goconst)


var formatter output.Formatter
switch cfg.Output.Format {
case "json":

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 [golangci] reported by reviewdog 🐶
string json has 4 occurrences, make it a constant (goconst)

@musaprg musaprg merged commit 9327bdd into main Jun 28, 2025
2 checks passed
@musaprg musaprg deleted the feature/reserves-encodes-subcommands branch June 28, 2025 12:19
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