Add phash generation and dupe checking (#1158)

This commit is contained in:
InfiniteTF
2021-04-12 01:04:40 +02:00
committed by GitHub
parent a2582047ca
commit c38660d209
70 changed files with 4342 additions and 214 deletions

View File

@@ -73,6 +73,11 @@ func (i *Importer) sceneJSONToScene(sceneJSON jsonschema.Scene) models.Scene {
Path: i.Path,
}
if sceneJSON.Phash != "" {
hash, err := strconv.ParseUint(sceneJSON.Phash, 16, 64)
newScene.Phash = sql.NullInt64{Int64: int64(hash), Valid: err == nil}
}
if sceneJSON.Title != "" {
newScene.Title = sql.NullString{String: sceneJSON.Title, Valid: true}
}