Skip to content

Skip re-downloads for existing converted files in UniversalDownloaderPlatform - #23

Open
ProtagNeptune wants to merge 1 commit into
AlexCSDev:masterfrom
ProtagNeptune:master
Open

Skip re-downloads for existing converted files in UniversalDownloaderPlatform#23
ProtagNeptune wants to merge 1 commit into
AlexCSDev:masterfrom
ProtagNeptune:master

Conversation

@ProtagNeptune

Copy link
Copy Markdown

Made this because it kept redownloading files that already existed as converted files to take less space on my drives.

…niversalDownloaderPlatform) (#1)

* Initial plan

* feat: resolve equivalent existing output files

Co-authored-by: ProtagNeptune <93203147+ProtagNeptune@users.noreply.github.com>

* Apply suggestions from code review

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

* feat: use resolved existing files in downloader pre-checks

Co-authored-by: ProtagNeptune <93203147+ProtagNeptune@users.noreply.github.com>

* Potential fix for pull request finding

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

* fix: skip downloads when converted equivalent file already exists

Co-authored-by: ProtagNeptune <93203147+ProtagNeptune@users.noreply.github.com>

* fix: address FileExistsActionHelper review feedback

Co-authored-by: ProtagNeptune <93203147+ProtagNeptune@users.noreply.github.com>

* fix: case-insensitive basename match and unknown remote size handling

Co-authored-by: ProtagNeptune <93203147+ProtagNeptune@users.noreply.github.com>

* WIP: plan fix for wildcard-safe basename enumeration

Co-authored-by: ProtagNeptune <93203147+ProtagNeptune@users.noreply.github.com>

* fix: avoid wildcard interpretation in ResolveExistingFilePath basename scan

Co-authored-by: ProtagNeptune <93203147+ProtagNeptune@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: ProtagNeptune <93203147+ProtagNeptune@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Copilot AI lite review requested due to automatic review settings August 9, 2026 16:09

Copilot AI left a comment

Copy link
Copy Markdown

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 aims to prevent unnecessary re-downloads when an already-downloaded “converted” variant of the target file exists on disk, reducing redundant network usage and local storage churn across multiple downloader engines.

Changes:

  • Added FileExistsActionHelper.ResolveExistingFilePath(...) and updated pre-download existence handling to recognize same-basename files with different extensions.
  • Updated Mega, Web, and Google Drive downloaders to use the new “existing path vs requested path” flow and to create the target directory more safely.
  • Introduced a new UniversalDownloaderPlatform.Common.Tests project with xUnit tests covering the new helper behaviors.

Reviewed changes

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

Show a summary per file
File Description
UniversalDownloaderPlatform.sln Adds the new Common test project to the solution and build configs.
UniversalDownloaderPlatform.MegaDownloader/MegaDownloader.cs Uses ResolveExistingFilePath + updated pre-download existence API; fixes directory creation logic.
UniversalDownloaderPlatform.GoogleDriveDownloader/GoogleDriveEngine.cs Moves/updates existence checks to happen after Google-doc export path selection; fixes directory creation logic.
UniversalDownloaderPlatform.DefaultImplementations/WebDownloader.cs Uses ResolveExistingFilePath + updated pre-download existence API; fixes directory creation logic.
UniversalDownloaderPlatform.Common/Helpers/FileExistsActionHelper.cs Implements “converted equivalent” detection and updates file-exists decision logic.
UniversalDownloaderPlatform.Common.Tests/UniversalDownloaderPlatform.Common.Tests.csproj New xUnit test project for Common helpers.
UniversalDownloaderPlatform.Common.Tests/FileExistsActionHelperTests.cs Adds unit tests for the new helper behaviors (exact match, converted-equivalent match, and size-check logic).

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

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.

3 participants