Skip to content
Snippets Groups Projects
Commit 50ca10a3 authored by Bruno Michel's avatar Bruno Michel
Browse files

Fix a bug in file dates

When a file is uploaded with no dates in the query-string, but with a
date in the EXIF metadata, we need to check that created_at can't come
after updated_at.
parent a1e3b3a2
No related branches found
No related tags found
No related merge requests found
......@@ -97,6 +97,9 @@ func (c *couchdbIndexer) prepareFileDoc(doc *FileDoc) error {
// taken on camera were the clock was never configured (e.g. 1970-01-01).
if date, ok := doc.Metadata["datetime"].(time.Time); ok && date.Year() > 1990 {
doc.CreatedAt = date
if doc.UpdatedAt.Before(date) {
doc.UpdatedAt = date
}
}
return nil
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment