mirror of
https://github.com/packwiz/packwiz.git
synced 2025-04-19 21:16:30 +02:00
Improve modlist.html generation performance by using the ID redirect URL
This commit is contained in:
parent
f1009a3289
commit
6557719c1f
@ -9,6 +9,7 @@ import (
|
||||
"github.com/spf13/viper"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"strconv"
|
||||
|
||||
"github.com/comp500/packwiz/core"
|
||||
"github.com/spf13/cobra"
|
||||
@ -308,16 +309,7 @@ func createModlist(zw *zip.Writer, mods []core.Mod) error {
|
||||
continue
|
||||
}
|
||||
project := projectRaw.(cfUpdateData)
|
||||
// TODO: store this in the metadata
|
||||
modInfo, err := getModInfo(project.ProjectID)
|
||||
if err != nil {
|
||||
_, err = w.WriteString("<li>" + mod.Name + "</li>\r\n")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
continue
|
||||
}
|
||||
_, err = w.WriteString("<li><a href=\"" + modInfo.WebsiteURL + "\">" + mod.Name + "</a></li>\r\n")
|
||||
_, err = w.WriteString("<li><a href=\"https://www.curseforge.com/projects/" + strconv.Itoa(project.ProjectID) + "\">" + mod.Name + "</a></li>\r\n")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user