Skip to content

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

:art: 集市已下载包在配置文件不正确的情况下不应该显示更新按钮 https://github.com/siyuan-note/siyuan/issues/5838

Liang Ding215c70db23c1
diff --git a/kernel/bazaar/package.go b/kernel/bazaar/package.go
index aac7d3316f..43eef97677 100644
--- a/kernel/bazaar/package.go
+++ b/kernel/bazaar/package.go
@@ -180,6 +180,12 @@ func isOutdatedTheme(theme *Theme, bazaarThemes []*Theme) bool {
return false
}
+ repo := strings.TrimPrefix(theme.URL, "https://github.com/")
+ parts := strings.Split(repo, "/")
+ if 2 != len(parts) || "" == strings.TrimSpace(parts[1]) {
+ return false
+ }
+
for _, pkg := range bazaarThemes {
if theme.URL == pkg.URL && theme.Name == pkg.Name && theme.Author == pkg.Author && theme.Version != pkg.Version {
theme.RepoHash = pkg.RepoHash
@@ -194,6 +200,12 @@ func isOutdatedIcon(icon *Icon, bazaarIcons []*Icon) bool {
return false
}
+ repo := strings.TrimPrefix(icon.URL, "https://github.com/")
+ parts := strings.Split(repo, "/")
+ if 2 != len(parts) || "" == strings.TrimSpace(parts[1]) {
+ return false
+ }
+
for _, pkg := range bazaarIcons {
if icon.URL == pkg.URL && icon.Name == pkg.Name && icon.Author == pkg.Author && icon.Version != pkg.Version {
icon.RepoHash = pkg.RepoHash
@@ -208,6 +220,12 @@ func isOutdatedWidget(widget *Widget, bazaarWidgets []*Widget) bool {
return false
}
+ repo := strings.TrimPrefix(widget.URL, "https://github.com/")
+ parts := strings.Split(repo, "/")
+ if 2 != len(parts) || "" == strings.TrimSpace(parts[1]) {
+ return false
+ }
+
for _, pkg := range bazaarWidgets {
if widget.URL == pkg.URL && widget.Name == pkg.Name && widget.Author == pkg.Author && widget.Version != pkg.Version {
widget.RepoHash = pkg.RepoHash
@@ -222,6 +240,12 @@ func isOutdatedTemplate(template *Template, bazaarTemplates []*Template) bool {
return false
}
+ repo := strings.TrimPrefix(template.URL, "https://github.com/")
+ parts := strings.Split(repo, "/")
+ if 2 != len(parts) || "" == strings.TrimSpace(parts[1]) {
+ return false
+ }
+
for _, pkg := range bazaarTemplates {
if template.URL == pkg.URL && template.Name == pkg.Name && template.Author == pkg.Author && template.Version != pkg.Version {
template.RepoHash = pkg.RepoHash