Conversation
added 3 commits
November 28, 2025 15:55
Contributor
There was a problem hiding this comment.
Pull request overview
This PR refactors the Pixiv command subcommand architecture by introducing a unified SubCommand abstract base class and reorganizing subcommands into a dedicated sub package. The changes standardize the invoke method signatures across all subcommands and add a new Add subcommand for manually adding artwork IDs.
Key changes:
- Introduced abstract
SubCommandbase class to standardize subcommand structure and eliminate duplicate logger initialization code - Moved all subcommand classes from
xyz.zcraft.acgpicdownload.commands.pixivtoxyz.zcraft.acgpicdownload.commands.pixiv.subpackage - Added new
Addsubcommand to allow manual addition of artwork IDs via command line
Reviewed changes
Copilot reviewed 12 out of 12 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| SubCommand.java | New abstract base class providing common logger initialization and standardized invoke method signature for all subcommands |
| Save.java | Refactored to extend SubCommand, updated package, and changed invoke method to return List |
| Load.java | Refactored to extend SubCommand, added append functionality (-a flag), and modernized switch syntax |
| Filter.java | Refactored to extend SubCommand, moved to sub package, and removed duplicate logger declarations |
| Fetch.java | Refactored to extend SubCommand, moved mode selection logic into invoke method, added append functionality, and renamed inner class from Fetch to Fetcher |
| Download.java | Refactored to extend SubCommand and updated invoke method to return List |
| Complete.java | Refactored to extend SubCommand with added BusyWait suppression comment |
| Add.java | New subcommand allowing manual addition of artwork IDs through comma-separated values |
| Pixiv.java | Updated to use new SubCommand architecture with factory pattern for subcommand instantiation |
| pom.xml | Version bumped from 3.5.0 to 3.5.1 |
| README.md | Simplified usage instructions to point to wiki |
| README.en.md | Simplified usage instructions to point to wiki |
Comments suppressed due to low confidence (8)
src/main/java/xyz/zcraft/acgpicdownload/commands/pixiv/sub/Fetch.java:30
- The error message on line 29 uses
argList.getFirst()but should useargList.get(1)to match the actual value being checked in the switch statement on line 23. This inconsistency means that when an invalid fetch mode is provided, the error message will display the wrong argument (the subcommand name instead of the invalid mode).
src/main/java/xyz/zcraft/acgpicdownload/commands/pixiv/sub/Fetch.java:23 - Accessing
argList.get(1)without checking if the list has at least 2 elements will cause an IndexOutOfBoundsException. Although line 19 checks if argList is empty, it should also verify that argList.size() > 1 before accessing index 1.
src/main/java/xyz/zcraft/acgpicdownload/commands/pixiv/sub/Complete.java:21 - This method overrides SubCommand.invoke; it is advisable to add an Override annotation.
src/main/java/xyz/zcraft/acgpicdownload/commands/pixiv/sub/Download.java:79 - This method overrides SubCommand.invoke; it is advisable to add an Override annotation.
src/main/java/xyz/zcraft/acgpicdownload/commands/pixiv/sub/Filter.java:16 - This method overrides SubCommand.invoke; it is advisable to add an Override annotation.
src/main/java/xyz/zcraft/acgpicdownload/commands/pixiv/sub/Load.java:16 - This method overrides SubCommand.invoke; it is advisable to add an Override annotation.
src/main/java/xyz/zcraft/acgpicdownload/commands/pixiv/sub/Save.java:19 - This method overrides SubCommand.invoke; it is advisable to add an Override annotation.
src/main/java/xyz/zcraft/acgpicdownload/commands/pixiv/sub/Fetch.java:18 - This method overrides SubCommand.invoke; it is advisable to add an Override annotation.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
src/main/java/xyz/zcraft/acgpicdownload/commands/pixiv/sub/Add.java
Outdated
Show resolved
Hide resolved
| import java.util.LinkedList; | ||
| import java.util.List; | ||
|
|
||
| public class Add extends SubCommand { |
There was a problem hiding this comment.
This method overrides SubCommand.invoke; it is advisable to add an Override annotation.
Suggested change
| public class Add extends SubCommand { | |
| public class Add extends SubCommand { | |
| @Override |
….java Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
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.
No description provided.