Skip to content

Commit

Permalink
feat(exif): Using more cache from exif
Browse files Browse the repository at this point in the history
Signed-off-by: Vincent Boutour <[email protected]>
  • Loading branch information
ViBiOh committed Aug 28, 2022
1 parent 22facdc commit ea74433
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion pkg/exif/aggregate.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ func (a App) computeAndSaveAggregate(ctx context.Context, dir absto.Item) error
return nil
}

exifData, err := a.loadExif(ctx, item)
exifData, err := a.GetExifFor(ctx, item)
if err != nil {
if absto.IsNotExist(err) {
return nil
Expand Down
2 changes: 1 addition & 1 deletion pkg/exif/amqp.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ func (a App) AMQPHandler(ctx context.Context, message amqp.Delivery) error {
return nil
}

exif, err := a.loadExif(ctx, resp.Item)
exif, err := a.GetExifFor(ctx, resp.Item)
if err != nil && !absto.IsNotExist(err) {
logger.WithField("item", resp.Item.Pathname).Error("load exif: %s", err)
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/exif/exif.go
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ func (a App) extractAndSaveExif(ctx context.Context, item absto.Item) (exif exas
return
}

previousExif, err := a.loadExif(ctx, item)
previousExif, err := a.GetExifFor(ctx, item)
if err != nil && !absto.IsNotExist(err) {
logger.WithField("item", item.Pathname).Error("load exif: %s", err)
}
Expand Down
4 changes: 2 additions & 2 deletions pkg/exif/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@ func Path(item absto.Item) string {

func (a App) hasMetadata(ctx context.Context, item absto.Item) bool {
if item.IsDir {
_, err := a.storageApp.Info(ctx, Path(item))
_, err := a.GetAggregateFor(ctx, item)
return err == nil
}

data, err := a.loadExif(ctx, item)
data, err := a.GetExifFor(ctx, item)
if err != nil {
return false
}
Expand Down

0 comments on commit ea74433

Please sign in to comment.