Add ignore autotag flag (#2439)

* Add autoTagIgnored to database schema
* Graphql changes
* UI changes
* Add field to edit performers dialog
* Apply flag to autotag behaviour
This commit is contained in:
WithoutPants
2022-04-04 20:03:39 +10:00
committed by GitHub
parent 2aee6cc18e
commit 61d9f57ce9
52 changed files with 477 additions and 206 deletions

View File

@@ -11,8 +11,9 @@ import (
// ToJSON converts a Studio object into its JSON equivalent.
func ToJSON(reader models.StudioReader, studio *models.Studio) (*jsonschema.Studio, error) {
newStudioJSON := jsonschema.Studio{
CreatedAt: models.JSONTime{Time: studio.CreatedAt.Timestamp},
UpdatedAt: models.JSONTime{Time: studio.UpdatedAt.Timestamp},
IgnoreAutoTag: studio.IgnoreAutoTag,
CreatedAt: models.JSONTime{Time: studio.CreatedAt.Timestamp},
UpdatedAt: models.JSONTime{Time: studio.UpdatedAt.Timestamp},
}
if studio.Name.Valid {

View File

@@ -31,6 +31,7 @@ const (
details = "details"
rating = 5
parentStudioName = "parentStudio"
autoTagIgnored = true
)
var parentStudio models.Studio = models.Studio{
@@ -66,7 +67,8 @@ func createFullStudio(id int, parentID int) models.Studio {
UpdatedAt: models.SQLiteTimestamp{
Timestamp: updateTime,
},
Rating: models.NullInt64(rating),
Rating: models.NullInt64(rating),
IgnoreAutoTag: autoTagIgnored,
}
if parentID != 0 {
@@ -106,6 +108,7 @@ func createFullJSONStudio(parentStudio, image string, aliases []string) *jsonsch
StashIDs: []models.StashID{
stashID,
},
IgnoreAutoTag: autoTagIgnored,
}
}

View File

@@ -26,13 +26,14 @@ func (i *Importer) PreImport() error {
checksum := md5.FromString(i.Input.Name)
i.studio = models.Studio{
Checksum: checksum,
Name: sql.NullString{String: i.Input.Name, Valid: true},
URL: sql.NullString{String: i.Input.URL, Valid: true},
Details: sql.NullString{String: i.Input.Details, Valid: true},
CreatedAt: models.SQLiteTimestamp{Timestamp: i.Input.CreatedAt.GetTime()},
UpdatedAt: models.SQLiteTimestamp{Timestamp: i.Input.UpdatedAt.GetTime()},
Rating: sql.NullInt64{Int64: int64(i.Input.Rating), Valid: true},
Checksum: checksum,
Name: sql.NullString{String: i.Input.Name, Valid: true},
URL: sql.NullString{String: i.Input.URL, Valid: true},
Details: sql.NullString{String: i.Input.Details, Valid: true},
IgnoreAutoTag: i.Input.IgnoreAutoTag,
CreatedAt: models.SQLiteTimestamp{Timestamp: i.Input.CreatedAt.GetTime()},
UpdatedAt: models.SQLiteTimestamp{Timestamp: i.Input.UpdatedAt.GetTime()},
Rating: sql.NullInt64{Int64: int64(i.Input.Rating), Valid: true},
}
if err := i.populateParentStudio(); err != nil {

View File

@@ -38,8 +38,9 @@ func TestImporterName(t *testing.T) {
func TestImporterPreImport(t *testing.T) {
i := Importer{
Input: jsonschema.Studio{
Name: studioName,
Image: invalidImage,
Name: studioName,
Image: invalidImage,
IgnoreAutoTag: autoTagIgnored,
},
}