1
Fork 0

Fix sidecar hash bug

This closes #276
This commit is contained in:
viktorstrate 2021-04-03 22:52:53 +02:00
parent 48605e60e0
commit 8ec2a7789b
No known key found for this signature in database
GPG Key ID: 3F855605109C1E8A
1 changed files with 1 additions and 6 deletions

View File

@ -39,14 +39,9 @@ func (Media) TableName() string {
}
func (m *Media) BeforeSave(tx *gorm.DB) error {
// Update hashes
// Update path hash
m.PathHash = MD5Hash(m.Path)
if m.SideCarPath != nil {
encodedHash := MD5Hash(*m.SideCarPath)
m.SideCarHash = &encodedHash
}
return nil
}