Skip to content

Don't show update error if all update tasks were filtered away#212

Merged
ManlyMarco merged 2 commits intomasterfrom
upd-fix
Jun 28, 2025
Merged

Don't show update error if all update tasks were filtered away#212
ManlyMarco merged 2 commits intomasterfrom
upd-fix

Conversation

@ManlyMarco
Copy link
Collaborator

No description provided.

@ManlyMarco ManlyMarco requested a review from Copilot June 28, 2025 17:13
Copy link

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 modifies the update task handling to prevent displaying an update error when there are no tasks to process. The key changes are:

  • Updated progress dialog logic to check for an empty updateTasks list.
  • Refactored and unified the return types for update items by introducing a new UpdateItems class.
  • Adjusted the GetUpdateItems method signatures in several updater classes to reflect the new type.

Reviewed Changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
src/KKManager.Updater/Windows/ModUpdateProgressDialog.cs Adds a condition to handle an empty updateTasks collection in the progress dialog.
src/KKManager.Updater/UpdateSourceManager.cs Updates update item retrieval to use the new UpdateItems wrapper and correctly sets success flags.
src/KKManager.Updater/Sources/UpdateSourceBase.cs Introduces the UpdateItems class and changes the return type of GetUpdateItems accordingly.
src/KKManager.Updater/Sources/TorrentUpdater.cs Changes the GetUpdateItems override signature to return UpdateItems and throws an exception.
src/KKManager.Updater/Sources/MegaUpdater.cs Adjusts the GetUpdateItems signature to use the new UpdateItems return type.
src/KKManager.Updater/Sources/FtpUpdater.cs Updates the GetUpdateItems signature to reflect the new UpdateItems return type.
Comments suppressed due to low confidence (4)

src/KKManager.Updater/Sources/UpdateSourceBase.cs:216

  • [nitpick] Consider adding XML documentation for the new UpdateItems class to clarify the purpose of AllInfos and FilteredTasks for maintainability and clarity.
            return new UpdateItems(allUpdateInfos, allResults);

src/KKManager.Updater/Sources/TorrentUpdater.cs:250

  • [nitpick] Ensure that consumers of TorrentUpdater understand that calling GetUpdateItems will always throw a NotSupportedException, and update the interface documentation accordingly.
            public override Task<UpdateItems> GetUpdateItems(CancellationToken cancellationToken, bool onlyDiscover, IProgress<float> progressCallback)

src/KKManager.Updater/Sources/MegaUpdater.cs:77

  • [nitpick] Verify that changing the return type to UpdateItems aligns with the expected usage across the system, and update related documentation or tests if needed.
        public override async Task<UpdateItems> GetUpdateItems(CancellationToken cancellationToken, bool onlyDiscover, IProgress<float> progressCallback)

src/KKManager.Updater/Sources/FtpUpdater.cs:128

  • [nitpick] Confirm that the updated signature with UpdateItems remains consistent with usage expectations in the overall update process, and adjust documentation if necessary.
        public override async Task<UpdateItems> GetUpdateItems(CancellationToken cancellationToken, bool onlyDiscover, IProgress<float> progressCallback)

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@ManlyMarco ManlyMarco merged commit fb8134a into master Jun 28, 2025
1 of 2 checks passed
@ManlyMarco ManlyMarco deleted the upd-fix branch June 28, 2025 17:22
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