fix(download): suffix only colliding quality variants

This commit is contained in:
zarzet
2026-07-29 02:43:35 +07:00
parent 1f55523b64
commit e7fbaf7b75
41 changed files with 629 additions and 110 deletions
+17
View File
@@ -26,6 +26,23 @@ func attemptExtensionDownload(
lastRetryAfterSeconds *int,
) (resp *DownloadResponse, cancelledOuter bool) {
outputPath := buildOutputPathForExtension(req, ext)
if shouldReuseExistingOutput(req, outputPath) {
result := DownloadResult{FilePath: outputPath}
enrichResultQualityFromFile(&result)
built := buildDownloadSuccessResponse(
req,
result,
providerLabel,
"File already exists",
outputPath,
true,
)
if req.ItemID != "" {
CompleteItemProgress(req.ItemID)
}
GoLog("[DownloadWithExtensionFallback] Keeping existing output instead of replacing it: %s\n", outputPath)
return &built, false
}
if req.ItemID != "" {
SetItemPreparingStage(req.ItemID, "resolving_stream")
}