Change ModID/FileID structs to use AddonFileReference

This commit is contained in:
comp500
2019-11-13 21:24:08 +00:00
parent 1ae7492625
commit f46ff894cc
4 changed files with 16 additions and 38 deletions

View File

@@ -174,7 +174,7 @@ var importCmd = &cobra.Command{
modsList := packImport.Mods()
modIDs := make([]int, len(modsList))
for i, v := range modsList {
modIDs[i] = v.ModID
modIDs[i] = v.ProjectID
}
fmt.Println("Querying Curse API for mod info...")
@@ -195,9 +195,9 @@ var importCmd = &cobra.Command{
referencedModPaths := make([]string, 0, len(modsList))
successes := 0
for _, v := range modsList {
modInfoValue, ok := modInfosMap[v.ModID]
modInfoValue, ok := modInfosMap[v.ProjectID]
if !ok {
fmt.Printf("Failed to obtain mod information for ID %d\n", v.ModID)
fmt.Printf("Failed to obtain mod information for ID %d\n", v.ProjectID)
continue
}
@@ -210,9 +210,9 @@ var importCmd = &cobra.Command{
}
}
if !found {
fileInfo, err = getFileInfo(v.ModID, v.FileID)
fileInfo, err = getFileInfo(v.ProjectID, v.FileID)
if err != nil {
fmt.Printf("Failed to obtain file information for Mod / File %d / %d: %s\n", v.ModID, v.FileID, err)
fmt.Printf("Failed to obtain file information for Mod / File %d / %d: %s\n", v.ProjectID, v.FileID, err)
continue
}
}