Skip to content

Commit

Permalink
Fix updatable file hashes stored under wrong key
Browse files Browse the repository at this point in the history
  • Loading branch information
NichtStudioCode committed Oct 25, 2024
1 parent fb9c3bc commit a62d980
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions nova/src/main/kotlin/xyz/xenondevs/nova/data/UpdatableFile.kt
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,12 @@ import kotlin.io.path.relativeTo
import kotlin.io.path.walk
import kotlin.io.path.writeBytes

private const val STORAGE_KEY = "updatable_file_hashes"
private val PLUGINS_DIR = Nova.dataFolder.parentFile.toPath()

object UpdatableFile {

private val fileHashes: HashMap<String, String> = PermanentStorage.retrieve("updatable_file_hashes") { HashMap() }
private val fileHashes: HashMap<String, String> = PermanentStorage.retrieve(STORAGE_KEY) { HashMap() }

internal fun extractIdNamedFromAllAddons(dirName: String) {
for (addon in AddonBootstrapper.addons) {
Expand Down Expand Up @@ -93,7 +94,7 @@ object UpdatableFile {

@DisableFun
private fun disable() {
PermanentStorage.store("updatableFileHashes", fileHashes)
PermanentStorage.store(STORAGE_KEY, fileHashes)
}

fun storeHash(file: Path, hash: ByteArray) {
Expand Down

0 comments on commit a62d980

Please sign in to comment.