Skip to content

Commit

Permalink
Fix #44: duplicate is not working
Browse files Browse the repository at this point in the history
  • Loading branch information
simulot committed Oct 27, 2023
1 parent ef0a893 commit 5522ed2
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 7 deletions.
18 changes: 11 additions & 7 deletions cmdduplicate/duplicate.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,9 @@ func DuplicateCommand(ctx context.Context, ic *immich.ImmichClient, log *logger.
case <-ctx.Done():
return ctx.Err()
default:
if a.IsTrashed {
continue
}
count++
if app.DateRange.InRange(a.ExifInfo.DateTimeOriginal.Time) {
k := duplicateKey{
Expand Down Expand Up @@ -143,16 +146,17 @@ func DuplicateCommand(ctx context.Context, ic *immich.ImmichClient, log *logger.
}
}
if yes {
log.OK(" Asset removed")
_, err = app.Immich.DeleteAssets(ctx, delete)
if err != nil {
log.Error("Can't delete asset: %s", err.Error())
}
for _, al := range albums {
log.OK(" Update the album %s with the best copy", al.AlbumName)
_, err = app.Immich.AddAssetToAlbum(ctx, al.ID, []string{a.ID})
if err != nil {
log.Error("Can't delete asset: %s", err.Error())
} else {
log.OK(" Asset removed")
for _, al := range albums {
log.OK(" Update the album %s with the best copy", al.AlbumName)
_, err = app.Immich.AddAssetToAlbum(ctx, al.ID, []string{a.ID})
if err != nil {
log.Error("Can't delete asset: %s", err.Error())
}
}
}
}
Expand Down
7 changes: 7 additions & 0 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -301,6 +301,13 @@ Additionally, deploying a Node.js program on user machines presents challenges.

## Release next

### Fix #44: duplicate is not working?

At 1st run of the duplicate command, low quality images are moved to the trash and not deleted as before 1.82.
At next run, the trashed files are still seen as duplicate.
The fix consist in not considering trashed files during duplicate detection


### Fix #39: another problems with Takeout archives

I have reworked the Google takeout import to handle #39 cases. Following cases are now handled:
Expand Down

0 comments on commit 5522ed2

Please sign in to comment.