mirror of
https://github.com/packwiz/packwiz.git
synced 2025-04-19 21:16:30 +02:00
Prefer Quilt mods to Fabric mods when using Quilt (Modrinth-only)
This commit is contained in:
parent
f533e677ca
commit
65688cf2b1
@ -4,6 +4,7 @@ import (
|
|||||||
"encoding/json"
|
"encoding/json"
|
||||||
"errors"
|
"errors"
|
||||||
"github.com/spf13/viper"
|
"github.com/spf13/viper"
|
||||||
|
"golang.org/x/exp/slices"
|
||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
"net/http"
|
"net/http"
|
||||||
"net/url"
|
"net/url"
|
||||||
@ -223,6 +224,12 @@ func getLatestVersion(modID string, pack core.Pack) (Version, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if semverCompare == 0 {
|
if semverCompare == 0 {
|
||||||
|
// Prefer Quilt over Fabric (Modrinth backend handles filtering)
|
||||||
|
if slices.Contains(v.Loaders, "quilt") && !slices.Contains(latestValidVersion.Loaders, "quilt") {
|
||||||
|
latestValidVersion = v
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
//Semver is equal, compare date instead
|
//Semver is equal, compare date instead
|
||||||
vDate, _ := time.Parse(time.RFC3339Nano, v.DatePublished)
|
vDate, _ := time.Parse(time.RFC3339Nano, v.DatePublished)
|
||||||
latestDate, _ := time.Parse(time.RFC3339Nano, latestValidVersion.DatePublished)
|
latestDate, _ := time.Parse(time.RFC3339Nano, latestValidVersion.DatePublished)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user