Skip to content

An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作

:art: Improve minimum version requirements for marketplace packages https://github.com/siyuan-note/siyuan/issues/16688

Daniel5db1723bfc56
diff --git a/kernel/bazaar/icon.go b/kernel/bazaar/icon.go
index 49799348b8..aae5697ddb 100644
--- a/kernel/bazaar/icon.go
+++ b/kernel/bazaar/icon.go
@@ -85,10 +85,7 @@ func Icons() (icons []*Icon) {
return
}
- if disallowDisplayBazaarPackage(icon.Package) {
- return
- }
-
+ icon.DisallowInstall = disallowInstallBazaarPackage(icon.Package)
icon.URL = strings.TrimSuffix(icon.URL, "/")
repoURLHash := strings.Split(repoURL, "@")
icon.RepoURL = "https://github.com/" + repoURLHash[0]
diff --git a/kernel/bazaar/package.go b/kernel/bazaar/package.go
index 2bf6bb3392..dd53ef4735 100644
--- a/kernel/bazaar/package.go
+++ b/kernel/bazaar/package.go
@@ -130,19 +130,20 @@ type Package struct {
PreviewURLThumb string `json:"previewURLThumb"`
IconURL string `json:"iconURL"`
- Installed bool `json:"installed"`
- Outdated bool `json:"outdated"`
- Current bool `json:"current"`
- Updated string `json:"updated"`
- Stars int `json:"stars"`
- OpenIssues int `json:"openIssues"`
- Size int64 `json:"size"`
- HSize string `json:"hSize"`
- InstallSize int64 `json:"installSize"`
- HInstallSize string `json:"hInstallSize"`
- HInstallDate string `json:"hInstallDate"`
- HUpdated string `json:"hUpdated"`
- Downloads int `json:"downloads"`
+ Installed bool `json:"installed"`
+ Outdated bool `json:"outdated"`
+ Current bool `json:"current"`
+ Updated string `json:"updated"`
+ Stars int `json:"stars"`
+ OpenIssues int `json:"openIssues"`
+ Size int64 `json:"size"`
+ HSize string `json:"hSize"`
+ InstallSize int64 `json:"installSize"`
+ HInstallSize string `json:"hInstallSize"`
+ HInstallDate string `json:"hInstallDate"`
+ HUpdated string `json:"hUpdated"`
+ Downloads int `json:"downloads"`
+ DisallowInstall bool `json:"disallowInstall"`
Incompatible bool `json:"incompatible"`
}
@@ -990,7 +991,7 @@ func getBazaarIndex() map[string]*bazaarPackage {
// Add marketplace package config item `minAppVersion` https://github.com/siyuan-note/siyuan/issues/8330
const defaultMinAppVersion = "2.9.0"
-func disallowDisplayBazaarPackage(pkg *Package) bool {
+func disallowInstallBazaarPackage(pkg *Package) bool {
if "" == pkg.MinAppVersion {
pkg.MinAppVersion = defaultMinAppVersion
}
diff --git a/kernel/bazaar/plugin.go b/kernel/bazaar/plugin.go
index e3c91a5e18..2d99d4f314 100644
--- a/kernel/bazaar/plugin.go
+++ b/kernel/bazaar/plugin.go
@@ -87,10 +87,7 @@ func Plugins(frontend string) (plugins []*Plugin) {
return
}
- if disallowDisplayBazaarPackage(plugin.Package) {
- return
- }
-
+ plugin.DisallowInstall = disallowInstallBazaarPackage(plugin.Package)
plugin.Incompatible = isIncompatiblePlugin(plugin, frontend)
plugin.URL = strings.TrimSuffix(plugin.URL, "/")
diff --git a/kernel/bazaar/template.go b/kernel/bazaar/template.go
index 7c09ee8695..b1f67b24f7 100644
--- a/kernel/bazaar/template.go
+++ b/kernel/bazaar/template.go
@@ -86,9 +86,7 @@ func Templates() (templates []*Template) {
return
}
- if disallowDisplayBazaarPackage(template.Package) {
- return
- }
+ template.DisallowInstall = disallowInstallBazaarPackage(template.Package)
template.URL = strings.TrimSuffix(template.URL, "/")
repoURLHash := strings.Split(repoURL, "@")
diff --git a/kernel/bazaar/theme.go b/kernel/bazaar/theme.go
index f9146a08a6..ea8d957f2a 100644
--- a/kernel/bazaar/theme.go
+++ b/kernel/bazaar/theme.go
@@ -87,9 +87,7 @@ func Themes() (ret []*Theme) {
return
}
- if disallowDisplayBazaarPackage(theme.Package) {
- return
- }
+ theme.DisallowInstall = disallowInstallBazaarPackage(theme.Package)
theme.URL = strings.TrimSuffix(theme.URL, "/")
repoURLHash := strings.Split(repoURL, "@")
diff --git a/kernel/bazaar/widget.go b/kernel/bazaar/widget.go
index 31bb0f758c..7f0a0cc889 100644
--- a/kernel/bazaar/widget.go
+++ b/kernel/bazaar/widget.go
@@ -85,9 +85,7 @@ func Widgets() (widgets []*Widget) {
return
}
- if disallowDisplayBazaarPackage(widget.Package) {
- return
- }
+ widget.DisallowInstall = disallowInstallBazaarPackage(widget.Package)
widget.URL = strings.TrimSuffix(widget.URL, "/")
repoURLHash := strings.Split(repoURL, "@")