From f21f17fc0c530b303160b18a5a76a9cb3b8ddbc6 Mon Sep 17 00:00:00 2001 From: 0neGal Date: Mon, 21 Aug 2023 20:02:27 +0200 Subject: properly detect installed packages in mod browser This doesn't break the old way of detecting things, for various reasons, but notably it'd cause more harm than good. As we still need to be able to detect packages that haven't been converted into the new location. --- src/app/js/browser.js | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/src/app/js/browser.js b/src/app/js/browser.js index ec5013a..fcbdc4f 100644 --- a/src/app/js/browser.js +++ b/src/app/js/browser.js @@ -136,12 +136,18 @@ var Browser = { for (let ii = 0; ii < modsobj.all.length; ii++) { let mod = modsobj.all[ii]; - if (normalize(mod.name) === normalized) { - local_name = mod.name; - local_version = version.format(mod.version); - if (version.is_newer(remote_version, local_version)) { - has_update = true; - } + if (normalize(mod.name) !== normalized && ( + ! mod.package || + mod.package.author + "-" + mod.package.package_name !== + packages[i].full_name + )) { + continue; + } + + local_name = mod.name; + local_version = version.format(mod.version); + if (version.is_newer(remote_version, local_version)) { + has_update = true; } } } -- cgit v1.2.3