Performer urls (#4958)

* Populate URLs from legacy fields
* Return nil properly in xpath/json scrapers
* Improve migration logging
This commit is contained in:
WithoutPants
2024-06-18 13:41:05 +10:00
committed by GitHub
parent fda4776d30
commit f26766033e
47 changed files with 992 additions and 379 deletions

View File

@@ -77,7 +77,7 @@ func createFullPerformer(id int, name string) *models.Performer {
ID: id,
Name: name,
Disambiguation: disambiguation,
URL: url,
URLs: models.NewRelatedStrings([]string{url, twitter, instagram}),
Aliases: models.NewRelatedStrings(aliases),
Birthdate: &birthDate,
CareerLength: careerLength,
@@ -90,11 +90,9 @@ func createFullPerformer(id int, name string) *models.Performer {
Favorite: true,
Gender: &genderEnum,
Height: &height,
Instagram: instagram,
Measurements: measurements,
Piercings: piercings,
Tattoos: tattoos,
Twitter: twitter,
CreatedAt: createTime,
UpdatedAt: updateTime,
Rating: &rating,
@@ -114,6 +112,7 @@ func createEmptyPerformer(id int) models.Performer {
CreatedAt: createTime,
UpdatedAt: updateTime,
Aliases: models.NewRelatedStrings([]string{}),
URLs: models.NewRelatedStrings([]string{}),
TagIDs: models.NewRelatedIDs([]int{}),
StashIDs: models.NewRelatedStashIDs([]models.StashID{}),
}
@@ -123,7 +122,7 @@ func createFullJSONPerformer(name string, image string) *jsonschema.Performer {
return &jsonschema.Performer{
Name: name,
Disambiguation: disambiguation,
URL: url,
URLs: []string{url, twitter, instagram},
Aliases: aliases,
Birthdate: birthDate.String(),
CareerLength: careerLength,
@@ -136,11 +135,9 @@ func createFullJSONPerformer(name string, image string) *jsonschema.Performer {
Favorite: true,
Gender: gender,
Height: strconv.Itoa(height),
Instagram: instagram,
Measurements: measurements,
Piercings: piercings,
Tattoos: tattoos,
Twitter: twitter,
CreatedAt: json.JSONTime{
Time: createTime,
},
@@ -161,6 +158,7 @@ func createFullJSONPerformer(name string, image string) *jsonschema.Performer {
func createEmptyJSONPerformer() *jsonschema.Performer {
return &jsonschema.Performer{
Aliases: []string{},
URLs: []string{},
StashIDs: []models.StashID{},
CreatedAt: json.JSONTime{
Time: createTime,