mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-16 22:50:13 +01:00
🎨 Improve the fallback logic of the marketplace
This commit is contained in:
parent
7217c66636
commit
78b35745b9
2 changed files with 8 additions and 1 deletions
|
|
@ -244,6 +244,8 @@ func getPreferredReadme(readme *Readme) string {
|
|||
defaultReadme := strings.TrimSpace(readme.Default)
|
||||
if defaultReadme != "" {
|
||||
ret = defaultReadme
|
||||
} else if "" != readme.EnUS {
|
||||
ret = readme.EnUS
|
||||
} else {
|
||||
ret = "README.md"
|
||||
}
|
||||
|
|
@ -323,6 +325,8 @@ func GetPreferredName(pkg *Package) string {
|
|||
defaultName := strings.TrimSpace(pkg.DisplayName.Default)
|
||||
if defaultName != "" {
|
||||
ret = defaultName
|
||||
} else if "" != pkg.DisplayName.EnUS {
|
||||
ret = pkg.DisplayName.EnUS
|
||||
} else {
|
||||
ret = pkg.Name
|
||||
}
|
||||
|
|
@ -402,6 +406,8 @@ func getPreferredDesc(desc *Description) string {
|
|||
defaultDesc := strings.TrimSpace(desc.Default)
|
||||
if defaultDesc != "" {
|
||||
ret = defaultDesc
|
||||
} else if "" != desc.EnUS {
|
||||
ret = desc.EnUS
|
||||
}
|
||||
}
|
||||
return ret
|
||||
|
|
|
|||
|
|
@ -247,9 +247,10 @@ func isIncompatiblePlugin(plugin *Plugin, currentFrontend string) bool {
|
|||
return false
|
||||
}
|
||||
|
||||
currentBackend := getCurrentBackend()
|
||||
backendOk := false
|
||||
for _, backend := range plugin.Backends {
|
||||
if backend == getCurrentBackend() || "all" == backend {
|
||||
if backend == currentBackend || "all" == backend {
|
||||
backendOk = true
|
||||
break
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue