Skip to content

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

:bug: 集市更新获取不同步的问题 Fix https://github.com/siyuan-note/siyuan/issues/7775

Liang Ding693945e1bf46
diff --git a/kernel/bazaar/icon.go b/kernel/bazaar/icon.go
index a7d2046398..dc29afc4e2 100644
--- a/kernel/bazaar/icon.go
+++ b/kernel/bazaar/icon.go
@@ -63,6 +63,7 @@ func Icons() (icons []*Icon) {
logging.LogErrorf("get bazaar package [%s] failed: %d", innerU, innerResp.StatusCode)
return
}
+ icon.URL = strings.TrimSuffix(icon.URL, "/")
repoURLHash := strings.Split(repoURL, "@")
icon.RepoURL = "https://github.com/" + repoURLHash[0]
@@ -125,6 +126,7 @@ func InstalledIcons() (ret []*Icon) {
icon.Name = iconConf["name"].(string)
icon.Author = iconConf["author"].(string)
icon.URL = iconConf["url"].(string)
+ icon.URL = strings.TrimSuffix(icon.URL, "/")
icon.Version = iconConf["version"].(string)
icon.RepoURL = icon.URL
icon.PreviewURL = "/appearance/icons/" + dirName + "/preview.png"
diff --git a/kernel/bazaar/template.go b/kernel/bazaar/template.go
index 53b72f2816..187226acdd 100644
--- a/kernel/bazaar/template.go
+++ b/kernel/bazaar/template.go
@@ -64,6 +64,7 @@ func Templates() (templates []*Template) {
logging.LogErrorf("get bazaar package [%s] failed: %d", innerU, innerResp.StatusCode)
return
}
+ template.URL = strings.TrimSuffix(template.URL, "/")
repoURLHash := strings.Split(repoURL, "@")
template.RepoURL = "https://github.com/" + repoURLHash[0]
@@ -125,6 +126,7 @@ func InstalledTemplates() (ret []*Template) {
template.Name = templateConf["name"].(string)
template.Author = templateConf["author"].(string)
template.URL = templateConf["url"].(string)
+ template.URL = strings.TrimSuffix(template.URL, "/")
template.Version = templateConf["version"].(string)
template.RepoURL = template.URL
template.PreviewURL = "/templates/" + dirName + "/preview.png"
diff --git a/kernel/bazaar/theme.go b/kernel/bazaar/theme.go
index c6aeca0c5b..7ff4a7363f 100644
--- a/kernel/bazaar/theme.go
+++ b/kernel/bazaar/theme.go
@@ -65,6 +65,7 @@ func Themes() (ret []*Theme) {
logging.LogErrorf("get bazaar package [%s] failed: %d", innerU, innerResp.StatusCode)
return
}
+ theme.URL = strings.TrimSuffix(theme.URL, "/")
repoURLHash := strings.Split(repoURL, "@")
theme.RepoURL = "https://github.com/" + repoURLHash[0]
@@ -127,6 +128,7 @@ func InstalledThemes() (ret []*Theme) {
theme.Name = themeConf["name"].(string)
theme.Author = themeConf["author"].(string)
theme.URL = themeConf["url"].(string)
+ theme.URL = strings.TrimSuffix(theme.URL, "/")
theme.Version = themeConf["version"].(string)
for _, mode := range themeConf["modes"].([]interface{}) {
theme.Modes = append(theme.Modes, mode.(string))
diff --git a/kernel/bazaar/widget.go b/kernel/bazaar/widget.go
index b90cf200f5..262693c9ab 100644
--- a/kernel/bazaar/widget.go
+++ b/kernel/bazaar/widget.go
@@ -64,6 +64,7 @@ func Widgets() (widgets []*Widget) {
logging.LogErrorf("get bazaar package [%s] failed: %d", innerU, innerResp.StatusCode)
return
}
+ widget.URL = strings.TrimSuffix(widget.URL, "/")
repoURLHash := strings.Split(repoURL, "@")
widget.RepoURL = "https://github.com/" + repoURLHash[0]
@@ -123,6 +124,7 @@ func InstalledWidgets() (ret []*Widget) {
widget.Name = widgetConf["name"].(string)
widget.Author = widgetConf["author"].(string)
widget.URL = widgetConf["url"].(string)
+ widget.URL = strings.TrimSuffix(widget.URL, "/")
widget.Version = widgetConf["version"].(string)
widget.RepoURL = widget.URL
widget.PreviewURL = "/widgets/" + dirName + "/preview.png"