From 163dbdeb3957a5c5556eb7a8a0c17e0324011579 Mon Sep 17 00:00:00 2001 From: Jian Sheng Date: Mon, 22 Dec 2025 17:57:36 +0800 Subject: [PATCH 1/2] add PublishModels Getters --- publish/builder.go | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/publish/builder.go b/publish/builder.go index bb515121b..02bf4c13b 100644 --- a/publish/builder.go +++ b/publish/builder.go @@ -692,3 +692,15 @@ func (b *Builder) defaultDisableByStatus(_ *web.EventContext, obj any) *Disablem DisabledDelete: disabled, } } + +func (b *Builder) GetVersionPublishModels() map[string]any { + return b.versionPublishModels +} + +func (b *Builder) GetNonVersionPublishModels() map[string]any { + return b.nonVersionPublishModels +} + +func (b *Builder) GetListPublishModels() map[string]any { + return b.listPublishModels +} From 21373ecf3202caf496bab0e99b32469b4dbc8d6f Mon Sep 17 00:00:00 2001 From: Jian Sheng Date: Mon, 22 Dec 2025 19:55:24 +0800 Subject: [PATCH 2/2] Add sizecopy to prevent the original size info from being modified. --- media/media_box.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/media/media_box.go b/media/media_box.go index f9937d33f..89640c8cb 100644 --- a/media/media_box.go +++ b/media/media_box.go @@ -558,9 +558,10 @@ func thumbName(name string, size *base.Size, fileSize int, f *media_library.Medi } if size != nil { title = name - base.SaleUpDown(f.Width, f.Height, size) - if size.Width != 0 && size.Height != 0 { - text = fmt.Sprintf("%d X %d", size.Width, size.Height) + sizeCopy := *size + base.SaleUpDown(f.Width, f.Height, &sizeCopy) + if sizeCopy.Width != 0 && sizeCopy.Height != 0 { + text = fmt.Sprintf("%d X %d", sizeCopy.Width, sizeCopy.Height) } } // if fileSize != 0 {