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

@@ -7,6 +7,7 @@ import (
"github.com/stashapp/stash/pkg/manager/jsonschema"
"github.com/stashapp/stash/pkg/models"
"github.com/stashapp/stash/pkg/models/mocks"
"github.com/stashapp/stash/pkg/utils"
"github.com/stretchr/testify/assert"
"testing"
@@ -43,6 +44,7 @@ const (
checksum = "checksum"
oshash = "oshash"
title = "title"
phash = -3846826108889195
date = "2001-01-01"
rating = 5
ocounter = 2
@@ -112,6 +114,7 @@ func createFullScene(id int) models.Scene {
Height: models.NullInt64(height),
OCounter: ocounter,
OSHash: models.NullString(oshash),
Phash: models.NullInt64(phash),
Rating: models.NullInt64(rating),
Organized: organized,
Size: models.NullString(size),
@@ -147,6 +150,7 @@ func createFullJSONScene(image string) *jsonschema.Scene {
Details: details,
OCounter: ocounter,
OSHash: oshash,
Phash: utils.PhashToString(phash),
Rating: rating,
Organized: organized,
URL: url,