Skip to content

Commit

Permalink
feat: String interning for tags
Browse files Browse the repository at this point in the history
Signed-off-by: Vincent Boutour <[email protected]>
  • Loading branch information
ViBiOh committed Sep 21, 2024
1 parent effd417 commit 6d4ebed
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion pkg/metadata/exif.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
"log/slog"
"net/http"
"strings"
"unique"

absto "github.com/ViBiOh/absto/pkg/model"
exas "github.com/ViBiOh/exas/pkg/model"
Expand Down Expand Up @@ -126,7 +127,13 @@ func New(ctx context.Context, config *Config, storageService absto.Storage, mete
return provider.Metadata{}, errInvalidItemType
}

return service.loadExif(ctx, item)
metadata, err := service.loadExif(ctx, item)

for index, tag := range metadata.Tags {
metadata.Tags[index] = unique.Make(tag).Value()
}

return metadata, err
}, traceProvider).
WithMaxConcurrency(provider.MaxConcurrency).
WithClientSideCaching(ctx, "fibr_exif", provider.MaxClientSideCaching)
Expand Down

0 comments on commit 6d4ebed

Please sign in to comment.