Skip to content

Dev#75

Merged
ZayrexDev merged 4 commits intomasterfrom
dev
Jan 4, 2026
Merged

Dev#75
ZayrexDev merged 4 commits intomasterfrom
dev

Conversation

@ZayrexDev
Copy link
Owner

No description provided.

Zayrex added 3 commits November 28, 2025 15:55
+一些命令添加了附加模式
*优化代码结构
Copilot AI review requested due to automatic review settings January 4, 2026 15:36
Copy link
Contributor

Copilot AI left a 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 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 SubCommand base class to standardize subcommand structure and eliminate duplicate logger initialization code
  • Moved all subcommand classes from xyz.zcraft.acgpicdownload.commands.pixiv to xyz.zcraft.acgpicdownload.commands.pixiv.sub package
  • Added new Add subcommand 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 use argList.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.

import java.util.LinkedList;
import java.util.List;

public class Add extends SubCommand {
Copy link

Copilot AI Jan 4, 2026

Choose a reason for hiding this comment

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

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

Copilot uses AI. Check for mistakes.
….java

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@ZayrexDev ZayrexDev merged commit 2bf0382 into master Jan 4, 2026
3 checks passed
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