fix(updateserver): extract version from asset filename, omit client for packages #467
@@ -37,7 +37,7 @@ type xmlUpdate struct {
|
||||
TargetPlatform xmlTargetPlat `xml:"targetplatform"`
|
||||
SHA256 string `xml:"sha256,omitempty"`
|
||||
SHA512 string `xml:"sha512,omitempty"`
|
||||
Client string `xml:"client"`
|
||||
Client string `xml:"client,omitempty"`
|
||||
PHPMinimum string `xml:"php_minimum,omitempty"`
|
||||
Description string `xml:"description,omitempty"`
|
||||
CreationDate string `xml:"creationDate,omitempty"`
|
||||
@@ -286,7 +286,15 @@ func GenerateJoomlaXML(ctx context.Context, repo *repo_model.Repository, require
|
||||
downloadURL = fmt.Sprintf("%s/archive/%s.zip", repoLink, rel.TagName)
|
||||
}
|
||||
|
||||
version := extractVersion(rel.TagName)
|
||||
// Extract version from the asset filename first (most accurate),
|
||||
// then fall back to tag name, then release title.
|
||||
version := ""
|
||||
if zipName != "" {
|
||||
version = extractVersion(zipName)
|
||||
}
|
||||
if version == "" {
|
||||
version = extractVersion(rel.TagName)
|
||||
}
|
||||
// If the tag is a stream name (not a version), try the release title instead.
|
||||
if version == "" || isStreamName(rel.TagName, streams) {
|
||||
version = extractVersion(rel.Title)
|
||||
@@ -313,12 +321,19 @@ func GenerateJoomlaXML(ctx context.Context, repo *repo_model.Repository, require
|
||||
infoURL = cfg.InfoURL
|
||||
}
|
||||
|
||||
// Joomla <client> element: only relevant for plugins/modules (site vs administrator).
|
||||
// Packages manage their own sub-extension clients; omit for package type.
|
||||
client := "site"
|
||||
if extType == "package" {
|
||||
client = ""
|
||||
}
|
||||
|
||||
u := xmlUpdate{
|
||||
Name: displayName,
|
||||
Description: desc,
|
||||
Element: element,
|
||||
Type: extType,
|
||||
Client: "site",
|
||||
Client: client,
|
||||
Version: version,
|
||||
CreationDate: time.Unix(int64(rel.CreatedUnix), 0).Format("2006-01-02"),
|
||||
InfoURL: xmlInfoURL{
|
||||
|
||||
Reference in New Issue
Block a user