mirror of
https://github.com/packwiz/packwiz-installer.git
synced 2025-04-19 13:06:30 +02:00
Fix optional and sided mod filtering properly
This commit is contained in:
parent
c2ee6fca8b
commit
858fd17f3e
@ -180,17 +180,19 @@ internal class DownloadTask private constructor(val metadata: IndexFile.File, de
|
|||||||
fun download(packFolder: String, indexUri: SpaceSafeURI) {
|
fun download(packFolder: String, indexUri: SpaceSafeURI) {
|
||||||
if (err != null) return
|
if (err != null) return
|
||||||
|
|
||||||
// Ensure wrong-side or optional false files are removed
|
// Exclude wrong-side and optional false files
|
||||||
cachedFile?.let {
|
cachedFile?.let {
|
||||||
if ((it.isOptional && !it.optionValue) || !correctSide()) {
|
if ((it.isOptional && !it.optionValue) || !correctSide()) {
|
||||||
if (it.cachedLocation != null) {
|
if (it.cachedLocation != null) {
|
||||||
|
// Ensure wrong-side or optional false files are removed
|
||||||
try {
|
try {
|
||||||
Files.deleteIfExists(Paths.get(packFolder, it.cachedLocation))
|
Files.deleteIfExists(Paths.get(packFolder, it.cachedLocation))
|
||||||
} catch (e: IOException) {
|
} catch (e: IOException) {
|
||||||
Log.warn("Failed to delete file before downloading", e)
|
Log.warn("Failed to delete file", e)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
it.cachedLocation = null
|
it.cachedLocation = null
|
||||||
|
return
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (alreadyUpToDate) return
|
if (alreadyUpToDate) return
|
||||||
|
Loading…
x
Reference in New Issue
Block a user