mirror of
https://github.com/stashapp/stash.git
synced 2025-12-17 04:14:39 +03:00
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:
@@ -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 {
|
||||
|
||||
@@ -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,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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,
|
||||
},
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user