Fix modrinth update message (fixes #50)

This commit is contained in:
comp500 2021-08-22 20:12:37 +01:00
parent 7ac193eb87
commit 92ba8effaa

View File

@ -64,9 +64,17 @@ func (u mrUpdater) CheckUpdate(mods []core.Mod, mcVersion string, pack core.Pack
continue continue
} }
newFilename := newVersion.Files[0].Filename
// Prefer the primary file
for _, v := range newVersion.Files {
if v.Primary {
newFilename = v.Filename
}
}
results[i] = core.UpdateCheck{ results[i] = core.UpdateCheck{
UpdateAvailable: true, UpdateAvailable: true,
UpdateString: mod.FileName + " -> " + newVersion.Files[0].Filename, UpdateString: mod.FileName + " -> " + newFilename,
CachedState: cachedStateStore{data.ModID, newVersion}, CachedState: cachedStateStore{data.ModID, newVersion},
} }
} }