From 076c5bc2b2b4a87781c202252296cfac93279d5c Mon Sep 17 00:00:00 2001 From: Giuseppe Lo Presti Date: Tue, 21 Sep 2021 19:12:29 +0200 Subject: [PATCH] Fixes following latest version of the mime type list --- pkg/app/app.go | 2 +- pkg/app/registry/static/static.go | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/pkg/app/app.go b/pkg/app/app.go index 8267f1d0489..a6edad2a022 100644 --- a/pkg/app/app.go +++ b/pkg/app/app.go @@ -31,7 +31,7 @@ import ( type Registry interface { FindProviders(ctx context.Context, mimeType string) ([]*registry.ProviderInfo, error) ListProviders(ctx context.Context) ([]*registry.ProviderInfo, error) - ListSupportedMimeTypes(ctx context.Context) (*registry.MimeTypeList, error) + ListSupportedMimeTypes(ctx context.Context) ([]*registry.MimeTypeInfo, error) AddProvider(ctx context.Context, p *registry.ProviderInfo) error GetDefaultProviderForMimeType(ctx context.Context, mimeType string) (*registry.ProviderInfo, error) SetDefaultProviderForMimeType(ctx context.Context, mimeType string, p *registry.ProviderInfo) error diff --git a/pkg/app/registry/static/static.go b/pkg/app/registry/static/static.go index d95577ed7f5..f25c49fb2c4 100644 --- a/pkg/app/registry/static/static.go +++ b/pkg/app/registry/static/static.go @@ -148,11 +148,11 @@ func (b *reg) ListProviders(ctx context.Context) ([]*registrypb.ProviderInfo, er return providers, nil } -func (b *reg) ListSupportedMimeTypes(ctx context.Context) (*registrypb.MimeTypeList, error) { +func (b *reg) ListSupportedMimeTypes(ctx context.Context) ([]*registrypb.MimeTypeInfo, error) { b.RLock() defer b.RUnlock() - res := registrypb.MimeTypeList{MimeTypes: []*registrypb.MimeTypeInfo{}} + res := []*registrypb.MimeTypeInfo{} mtmap := make(map[string]*registrypb.MimeTypeInfo) for _, p := range b.providers { t := *p @@ -168,11 +168,11 @@ func (b *reg) ListSupportedMimeTypes(ctx context.Context) (*registrypb.MimeTypeL Description: "", Icon: "", } - res.MimeTypes = append(res.MimeTypes, mtmap[m]) + res = append(res, mtmap[m]) } } } - return &res, nil + return res, nil } func (b *reg) SetDefaultProviderForMimeType(ctx context.Context, mimeType string, p *registrypb.ProviderInfo) error {