From 92ba8effaa3cab6331312b79bc0430a807f52483 Mon Sep 17 00:00:00 2001 From: comp500 Date: Sun, 22 Aug 2021 20:12:37 +0100 Subject: [PATCH] Fix modrinth update message (fixes #50) --- modrinth/updater.go | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/modrinth/updater.go b/modrinth/updater.go index 379f324..077e2ef 100644 --- a/modrinth/updater.go +++ b/modrinth/updater.go @@ -64,9 +64,17 @@ func (u mrUpdater) CheckUpdate(mods []core.Mod, mcVersion string, pack core.Pack 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{ UpdateAvailable: true, - UpdateString: mod.FileName + " -> " + newVersion.Files[0].Filename, + UpdateString: mod.FileName + " -> " + newFilename, CachedState: cachedStateStore{data.ModID, newVersion}, } }