Skip to content

Commit

Permalink
change sentence order since maxCacheSizeGB should have priority over …
Browse files Browse the repository at this point in the history
…the other sentences
  • Loading branch information
hugomontero committed Jan 31, 2025
1 parent 953c282 commit c0e3e11
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/lib/download-manager.js
Original file line number Diff line number Diff line change
Expand Up @@ -142,16 +142,15 @@ class DownloadManager {
}

async _shouldCleanCache({ downloadedCacheSizeGB, alwaysCleanCache, maxCacheSizeGB, totalSizeGB, downloadDirStats }) {
if (totalSizeGB < maxCacheSizeGB || downloadDirStats.fileStats.length === 0) {
return false;
}
if (maxCacheSizeGB === 0 || alwaysCleanCache) {
return true;
}
if (maxCacheSizeGB === -1) {
return false;
}

if (totalSizeGB < maxCacheSizeGB || downloadDirStats.fileStats.length === 0) {
return false;
}
const question = {
type: 'confirm',
name: 'cleanCache',
Expand Down

0 comments on commit c0e3e11

Please sign in to comment.