mirror of
https://github.com/stashapp/stash.git
synced 2025-12-17 04:14:39 +03:00
Added rating to performers and studios (#1308)
This commit is contained in:
@@ -38,6 +38,10 @@ func ToJSON(reader models.StudioReader, studio *models.Studio) (*jsonschema.Stud
|
||||
}
|
||||
}
|
||||
|
||||
if studio.Rating.Valid {
|
||||
newStudioJSON.Rating = int(studio.Rating.Int64)
|
||||
}
|
||||
|
||||
image, err := reader.GetImage(studio.ID)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("error getting studio image: %s", err.Error())
|
||||
|
||||
@@ -25,10 +25,10 @@ const (
|
||||
)
|
||||
|
||||
const (
|
||||
studioName = "testStudio"
|
||||
url = "url"
|
||||
details = "details"
|
||||
|
||||
studioName = "testStudio"
|
||||
url = "url"
|
||||
details = "details"
|
||||
rating = 5
|
||||
parentStudioName = "parentStudio"
|
||||
)
|
||||
|
||||
@@ -55,6 +55,7 @@ func createFullStudio(id int, parentID int) models.Studio {
|
||||
UpdatedAt: models.SQLiteTimestamp{
|
||||
Timestamp: updateTime,
|
||||
},
|
||||
Rating: models.NullInt64(rating),
|
||||
}
|
||||
|
||||
if parentID != 0 {
|
||||
@@ -89,6 +90,7 @@ func createFullJSONStudio(parentStudio, image string) *jsonschema.Studio {
|
||||
},
|
||||
ParentStudio: parentStudio,
|
||||
Image: image,
|
||||
Rating: rating,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -31,6 +31,7 @@ func (i *Importer) PreImport() error {
|
||||
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},
|
||||
}
|
||||
|
||||
if err := i.populateParentStudio(); err != nil {
|
||||
|
||||
Reference in New Issue
Block a user