Skip to content

Enhance DownloadsPanel and Gofile error handling improvements#198

Merged
Stivenjs merged 3 commits into
mainfrom
console-mode
May 21, 2026
Merged

Enhance DownloadsPanel and Gofile error handling improvements#198
Stivenjs merged 3 commits into
mainfrom
console-mode

Conversation

@Stivenjs
Copy link
Copy Markdown
Owner

This pull request refactors and improves the HTTP hoster download subsystem, focusing on unifying network client usage, enhancing error handling, and improving the download job model. The main changes include consolidating hoster network logic into a new module, standardizing error reporting for hoster downloads, and making HTTP download jobs more robust and easier to manage.

Network Client Refactor and Consolidation

  • Introduced a new hoster_download module that centralizes all hoster-related HTTP client logic, replacing the previous scattered approach. The new HOSTER_DOWNLOAD_CLIENT is now used for all hoster download and resolution operations, and the related constants and client definitions have been removed from individual hoster modules. (apps/desktop/src-tauri/src/network/mod.rs, apps/desktop/src-tauri/src/sources/hosters/constants.rs, [1] [2] [3] [4]

Error Handling Improvements

  • Enhanced the HosterError enum and associated helpers to provide more detailed, user-friendly error messages, especially for Gofile and other major hosters. Added conversion from HttpStatusError and utility functions for common error scenarios. (apps/desktop/src-tauri/src/sources/hosters/error.rs, [1] [2]

Hoster Resolution Logic Update

  • Updated hoster resolver functions (e.g., Buzzheavier, Datanodes, FuckingFast) to accept a shared client and utilize the new network module's helpers, ensuring consistent request profiles and error handling. (apps/desktop/src-tauri/src/sources/hosters/buzzheavier.rs, apps/desktop/src-tauri/src/sources/hosters/datanodes.rs, apps/desktop/src-tauri/src/sources/hosters/fuckingfast.rs, [1] [2] [3] [4] [5] [6] [7]

Download Job Model Enhancements

  • Added an output_file_name field to the SourceDownloadJob struct, allowing the resolved filename to be tracked and reused for cancellation and management. Updated job creation and cancellation logic to use this field. (apps/desktop/src-tauri/src/sources/domain.rs, apps/desktop/src-tauri/src/sources/commands.rs, [1] [2] [3]

HTTP Download Protocol Handling

  • Improved handling of HTTP download jobs: clarified that HTTP downloads cannot be paused or resumed (only canceled), and updated the related user-facing messages and logic to reflect this. (apps/desktop/src-tauri/src/sources/commands.rs, [1] [2] [3]

These changes make the hoster download subsystem more maintainable, robust, and user-friendly, especially in terms of error diagnosis and job management.

Stivenjs added 3 commits May 21, 2026 13:13
- Added support for resuming downloads in the DownloadsPanel by introducing a new `canResume` property.
- Updated logic to determine when downloads can be paused or resumed based on the protocol and status.
- Modified the download cancellation process to handle output file names correctly.
- Improved error handling for HTTP downloads, ensuring proper user feedback for unsupported operations.
- Refactored hoster resolution functions to streamline the download process and improve maintainability.
- Enhanced error messages for Gofile API responses, providing clearer user feedback for various error states.
- Refactored error handling in the Gofile module to utilize new helper functions for better maintainability.
- Updated the HTTP download process to include more specific error messages based on the URI, improving user experience during downloads.
- Removed outdated error handling code to streamline the overall error management system.
- Updated the process listing logic to iterate directly over process values, improving code clarity and performance.
- Removed unnecessary tuple destructuring for a more straightforward approach to accessing process data.
@Stivenjs Stivenjs self-assigned this May 21, 2026
@Stivenjs Stivenjs added bug Something isn't working enhancement New feature or request good first issue Good for newcomers labels May 21, 2026
@Stivenjs Stivenjs merged commit dbec93d into main May 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working enhancement New feature or request good first issue Good for newcomers

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant