Publish Docker image (Multi-arch) / Build & push (amd64) (push) Failing after 1m40s
Release (Linux, macOS, Windows) / Linux Release (push) Failing after 42m16s
Publish Docker image (Multi-arch) / Build & push (arm64) (push) Canceled after 0s
Release (Linux, macOS, Windows) / macOS Release (push) Canceled after 0s
Release (Linux, macOS, Windows) / Windows Release (push) Canceled after 0s
Publish Docker image (Multi-arch) / Create multi-arch manifests (push) Canceled after 0s
Sync production source including routing, billing, Astra detection and public uptime. Update custom build instructions and license packaging.
28 lines
736 B
Go
28 lines
736 B
Go
package controller
|
|
|
|
import (
|
|
"github.com/tidwall/gjson"
|
|
"net/url"
|
|
)
|
|
|
|
func manxueArtworkURL(result gjson.Result) string {
|
|
for _, key := range []string{"share_url", "public_url", "result_url", "result.share_url", "result.public_url"} {
|
|
raw := result.Get(key).String()
|
|
u, err := url.Parse(raw)
|
|
if err == nil && u.Scheme == "https" && u.Host == "manxue.ai" && u.User == nil && u.Query().Get("result") != "" {
|
|
return u.String()
|
|
}
|
|
}
|
|
id := result.Get("public_id").String()
|
|
if id == "" {
|
|
id = result.Get("result.public_id").String()
|
|
}
|
|
if id == "" && result.Get("public").Bool() {
|
|
id = result.Get("result.id").String()
|
|
}
|
|
if id == "" {
|
|
return ""
|
|
}
|
|
return "https://manxue.ai/?" + url.Values{"result": {id}}.Encode()
|
|
}
|