Skip to content

Commit

Permalink
refactor: Avoid duplicate content in neighborhood func
Browse files Browse the repository at this point in the history
Signed-off-by: Vincent Boutour <[email protected]>
  • Loading branch information
ViBiOh committed Aug 16, 2022
1 parent 610e238 commit 695427d
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions pkg/thumbnail/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,8 @@ func (a App) HasLargeThumbnail(ctx context.Context, item absto.Item) bool {

// HasThumbnail determine if thumbnail exist for given pathname
func (a App) HasThumbnail(ctx context.Context, item absto.Item, scale uint64) bool {
if item.IsDir {
return false
}

_, err := a.storageApp.Info(ctx, a.PathForScale(item, scale))
return err == nil
_, ok := a.ThumbnailInfo(ctx, item, scale)
return ok
}

// ThumbnailInfo determine if thumbnail exist for given pathname and provide detail about it
Expand Down

0 comments on commit 695427d

Please sign in to comment.