✨ Make it more implementable
This commit is contained in:
@@ -99,6 +99,14 @@ func AnalyzeAttachment(file models.Attachment) error {
|
||||
|
||||
var start time.Time
|
||||
|
||||
if len(file.HashCode) == 0 {
|
||||
if hash, err := HashAttachment(file); err != nil {
|
||||
return err
|
||||
} else {
|
||||
file.HashCode = hash
|
||||
}
|
||||
}
|
||||
|
||||
// Do analyze jobs
|
||||
if !file.IsAnalyzed || len(file.HashCode) == 0 {
|
||||
destMap := viper.GetStringMap("destinations.temporary")
|
||||
@@ -158,12 +166,6 @@ func AnalyzeAttachment(file models.Attachment) error {
|
||||
"color_space": stream.ColorSpace,
|
||||
}
|
||||
}
|
||||
|
||||
if hash, err := HashAttachment(file); err != nil {
|
||||
return err
|
||||
} else {
|
||||
file.HashCode = hash
|
||||
}
|
||||
}
|
||||
|
||||
tx := database.C.Begin()
|
||||
|
Reference in New Issue
Block a user