feat(rules): Implement comprehensive recording rules management#3
Merged
feat(rules): Implement comprehensive recording rules management#3
Conversation
## Major New Feature: Recording Rules Management Add complete CRUD operations for EPGStation recording rules, the most critical missing functionality. ### New Commands - `rules list` - List all recording rules with real IDs and status - `rules show <rule-id>` - Show detailed rule configuration - `rules create` - Create new rules with keyword/channel options - `rules delete <rule-id>` - Delete existing rules - `rules enable <rule-id>` - Enable disabled rules - `rules disable <rule-id>` - Disable rules without deletion ### Key Improvements - **Fixed API Integration Issue**: Resolved missing rule ID field in generated types - **Custom Data Types**: Added RuleWithID/RulesWithID to handle proper rule responses - **Enhanced Client Wrapper**: Added 8 new recording rules API methods - **Professional Formatting**: Clean table display and detailed rule views - **Full JSON Support**: Complete automation compatibility ### API Client Extensions - GetRules(), GetRule(), CreateRule(), UpdateRule() - DeleteRule(), EnableRule(), DisableRule(), SearchRulesKeyword() - Proper error handling and response parsing for all operations ### Real-World Testing - Tested against live EPGStation server with 24 active recording rules - Verified all CRUD operations with actual rule IDs (3730+) - Confirmed anime series recording automation functionality ### Technical Details - Fixed code generation issue where Rule type lacked required ID field - Created corrected data structures to properly handle EPGStation API responses - Maintained backward compatibility with existing commands - Added comprehensive CLI help and flag documentation This implementation transforms epgstationctl from a basic viewing tool into a comprehensive EPGStation management CLI, covering the core recording automation workflow. Closes: Major missing functionality gap Enables: Complete recording rules lifecycle management Tested: Live EPGStation server with real recording rules
Fix issue where rule enabled/disabled status was not properly reflected in the rules list view after enable/disable operations. ## Problem - Rules list always showed "Enabled" status regardless of actual state - Status logic only checked IsTimeSpecification, ignored ReserveOption.Enable - Individual rule view (rules show) displayed correct status but list didn't ## Solution - Update formatRulesAsTable to check rule.ReserveOption.Enable field - Proper status determination: Disabled -> Enabled -> Time-based priority - Status now correctly reflects actual rule state in both list and detail views ## Testing - Verified with rule 3730 and 3731 disable/enable operations - Confirmed status changes are immediately reflected in rules list - Both table and detailed views now show consistent status information Fixes: Rules status display inconsistency Tested: Live EPGStation server with rule enable/disable operations
…g N/A The UpdateTime field was using ReservesCnt data which is not present in the API response, causing it to always display "N/A". Since this field wasn't providing useful information, it has been removed to clean up the rules list output. The rules list now shows only essential information: ID, Status, Keyword, and Channels.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Key Changes
internal/client/wrapper.go) with 8 new recording rules methodsinternal/commands/rules/rules.go) with comprehensive functionality:rules list- List all recording rules with statusrules show <rule-id>- Show detailed rule configurationrules create- Create new rule with comprehensive flagsrules delete <rule-id>- Delete recording rulerules enable <rule-id>- Enable disabled rulerules disable <rule-id>- Disable rule without deletionRuleWithIDandRulesWithIDtypesTesting
✅ All commands tested with EPGStation server
http://popplio.foxhound-kelvin.ts.net:8888✅ CRUD operations verified - create, read, update, delete all working
✅ Status changes confirmed - enable/disable operations reflect properly
✅ Output formatting verified - clean table output without redundant fields
✅ Linting passed - golangci-lint issues resolved
Test commands:
Related Issues
Architecture
internal/commands/