Don't show update error if all update tasks were filtered away#212
Merged
ManlyMarco merged 2 commits intomasterfrom Jun 28, 2025
Merged
Don't show update error if all update tasks were filtered away#212ManlyMarco merged 2 commits intomasterfrom
ManlyMarco merged 2 commits intomasterfrom
Conversation
There was a problem hiding this comment.
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>
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.