Skip to content

Commit

Permalink
Fixes following latest version of the mime type list
Browse files Browse the repository at this point in the history
  • Loading branch information
glpatcern committed Sep 22, 2021
1 parent c33de4d commit 8cb06fe
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion pkg/app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 4 additions & 4 deletions pkg/app/registry/static/static.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 {
Expand Down

0 comments on commit 8cb06fe

Please sign in to comment.