Skip to content

Commit

Permalink
refactor: update fileCreatedAt handling to use modified time when cap…
Browse files Browse the repository at this point in the history
…ture date is zero
  • Loading branch information
simulot committed Nov 28, 2024
1 parent cb9ecde commit 8102b20
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion immich/asset.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,12 @@ func (ic *ImmichClient) AssetUpload(ctx context.Context, la *assets.Asset) (Asse
if err != nil {
return
}
err = m.WriteField("fileCreatedAt", la.CaptureDate.Format(TimeFormat))

if !la.CaptureDate.IsZero() {
err = m.WriteField("fileCreatedAt", la.CaptureDate.Format(TimeFormat))
} else {
err = m.WriteField("fileCreatedAt", s.ModTime().Format(TimeFormat))
}
if err != nil {
return
}
Expand Down

0 comments on commit 8102b20

Please sign in to comment.