Cleanup: remove leftover empty package folders after extract
This commit is contained in:
parent
49e62c1f83
commit
650988c7ac
@ -169,6 +169,12 @@ The app stores runtime files in Electron's `userData` directory, including:
|
||||
|
||||
Release history is available on [git.24-music.de Releases](https://git.24-music.de/Administrator/real-debrid-downloader/releases).
|
||||
|
||||
### v1.6.61 (2026-03-05)
|
||||
|
||||
- Fixed leftover empty package folders in `Downloader Unfertig` after successful extraction.
|
||||
- Resume marker files (`.rd_extract_progress*.json`) are now treated as ignorable for empty-folder cleanup.
|
||||
- Deferred post-processing now clears resume markers before running empty-directory removal.
|
||||
|
||||
### v1.6.60 (2026-03-05)
|
||||
|
||||
- Added package-scoped password cache for extraction: once the first archive in a package is solved, following archives in the same package reuse that password first.
|
||||
|
||||
@ -334,9 +334,11 @@ const EMPTY_DIR_IGNORED_FILE_NAMES = new Set([
|
||||
"desktop.ini",
|
||||
".ds_store"
|
||||
]);
|
||||
const EMPTY_DIR_IGNORED_FILE_RE = /^\.rd_extract_progress(?:_[^.\\/]+)?\.json$/i;
|
||||
|
||||
function isIgnorableEmptyDirFileName(fileName: string): boolean {
|
||||
return EMPTY_DIR_IGNORED_FILE_NAMES.has(String(fileName || "").trim().toLowerCase());
|
||||
const normalized = String(fileName || "").trim().toLowerCase();
|
||||
return EMPTY_DIR_IGNORED_FILE_NAMES.has(normalized) || EMPTY_DIR_IGNORED_FILE_RE.test(normalized);
|
||||
}
|
||||
|
||||
function toWindowsLongPathIfNeeded(filePath: string): string {
|
||||
@ -7121,6 +7123,13 @@ export class DownloadManager extends EventEmitter {
|
||||
}
|
||||
}
|
||||
|
||||
// ── Resume state cleanup ──
|
||||
if (extractedCount > 0 && failed === 0) {
|
||||
await clearExtractResumeState(pkg.outputDir, packageId);
|
||||
// Backward compatibility: older versions used .rd_extract_progress.json without package suffix.
|
||||
await clearExtractResumeState(pkg.outputDir);
|
||||
}
|
||||
|
||||
// ── Empty directory tree removal ──
|
||||
if (extractedCount > 0 && failed === 0 && this.settings.cleanupMode === "delete") {
|
||||
if (!(await hasAnyFilesRecursive(pkg.outputDir))) {
|
||||
@ -7131,11 +7140,6 @@ export class DownloadManager extends EventEmitter {
|
||||
}
|
||||
}
|
||||
|
||||
// ── Resume state cleanup ──
|
||||
if (extractedCount > 0 && failed === 0) {
|
||||
await clearExtractResumeState(pkg.outputDir, packageId);
|
||||
}
|
||||
|
||||
// ── MKV collection ──
|
||||
if (success > 0 && (pkg.status === "completed" || pkg.status === "failed")) {
|
||||
pkg.postProcessLabel = "Verschiebe MKVs...";
|
||||
|
||||
Loading…
Reference in New Issue
Block a user