-
Notifications
You must be signed in to change notification settings - Fork 1
feat: add PlayCover controller and new resource posts #15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…urce loading paths close #14
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry @dongwlin, your pull request is larger than the review limit of 150000 diff characters
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This pull request introduces significant refactoring and feature additions to the MAA Go bindings. The changes focus on reorganizing the pipeline/node code structure and adding new API capabilities.
Key Changes
- Refactored pipeline code by extracting all Node-related types and functions from
pipeline.gointo a newnode.gofile - Added new resource loading methods:
PostOcrModel,PostPipeline, andPostImage - Added support for PlayCover controller
- Introduced new recognition types (And, Or) and node configuration fields (Repeat, RepeatDelay, RepeatWaitFreezes)
- Updated GitHub Actions workflow to support pre-release downloads
Reviewed changes
Copilot reviewed 6 out of 7 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| resource.go | Added three new Post methods for loading OCR models, pipelines, and images separately |
| pipeline.go | Removed all Node-related code (moved to node.go), added conceptual documentation comments |
| node.go | New file containing all Node types, methods, and helper functions previously in pipeline.go, plus new features |
| node_test.go | New test file with basic tests for Node manipulation methods |
| controller.go | Added NewPlayCoverController function for PlayCover support |
| internal/native/framework.go | Registered new native functions for resource loading and PlayCover controller |
| .github/workflows/test.yml | Updated release-downloader version and added preRelease parameter |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| // AddNext appends a node to the next list and returns the node for chaining. | ||
| func (n *Node) AddNext(name string, opts ...NodeAttributeOption) *Node { | ||
| if name == "" { | ||
| return n | ||
| } | ||
|
|
||
| newItem := NodeNextItem{ | ||
| Name: name, | ||
| } | ||
| for _, opt := range opts { | ||
| opt(&newItem) | ||
| } | ||
|
|
||
| found := false | ||
| for i, item := range n.Next { | ||
| if item.Name == name { | ||
| n.Next[i] = newItem | ||
| found = true | ||
| break | ||
| } | ||
| } | ||
|
|
||
| if !found { | ||
| n.Next = append(n.Next, newItem) | ||
| } | ||
| return n | ||
| } |
Copilot
AI
Dec 31, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The AddNext method has changed behavior to update existing items with the same name instead of ignoring duplicates. This is a breaking change that should be covered by tests. Consider adding a test case that verifies when calling AddNext with the same name but different options (e.g., WithJumpBack()), the existing item is updated with the new options.
| // AddOnError appends a node to the on_error list and returns the node for chaining. | ||
| func (n *Node) AddOnError(name string, opts ...NodeAttributeOption) *Node { | ||
| if name == "" { | ||
| return n | ||
| } | ||
|
|
||
| newItem := NodeNextItem{ | ||
| Name: name, | ||
| } | ||
| for _, opt := range opts { | ||
| opt(&newItem) | ||
| } | ||
|
|
||
| found := false | ||
| for i, item := range n.OnError { | ||
| if item.Name == name { | ||
| n.OnError[i] = newItem | ||
| found = true | ||
| break | ||
| } | ||
| } | ||
|
|
||
| if !found { | ||
| n.OnError = append(n.OnError, newItem) | ||
| } | ||
| return n | ||
| } |
Copilot
AI
Dec 31, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The AddOnError method has changed behavior to update existing items with the same name instead of ignoring duplicates. This is a breaking change that should be covered by tests. Consider adding a test case that verifies when calling AddOnError with the same name but different options (e.g., WithAnchor()), the existing item is updated with the new options.
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
|
@sourcery-ai title |
No description provided.