diff --git a/app/plugin.go b/app/plugin.go index f13fa1d054..07beedfe9a 100644 --- a/app/plugin.go +++ b/app/plugin.go @@ -11,6 +11,7 @@ import ( "net/http" "os" "path/filepath" + "runtime" "sort" "strings" "sync" @@ -671,6 +672,8 @@ func (a *App) getBaseMarketplaceFilter() *model.MarketplacePluginFilter { filter.BuildEnterpriseReady = true } + filter.Platform = runtime.GOOS + "-" + runtime.GOARCH + return filter } diff --git a/model/marketplace_plugin.go b/model/marketplace_plugin.go index 4764451390..01daa8aaa6 100644 --- a/model/marketplace_plugin.go +++ b/model/marketplace_plugin.go @@ -81,6 +81,7 @@ type MarketplacePluginFilter struct { BuildEnterpriseReady bool EnterprisePlugins bool LocalOnly bool + Platform string } // ApplyToURL modifies the given url to include query string parameters for the request. @@ -95,6 +96,7 @@ func (filter *MarketplacePluginFilter) ApplyToURL(u *url.URL) { q.Add("build_enterprise_ready", strconv.FormatBool(filter.BuildEnterpriseReady)) q.Add("enterprise_plugins", strconv.FormatBool(filter.EnterprisePlugins)) q.Add("local_only", strconv.FormatBool(filter.LocalOnly)) + q.Add("platform", filter.Platform) u.RawQuery = q.Encode() }