Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix performer height filter error #388

Merged
merged 2 commits into from
Mar 2, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 13 additions & 12 deletions pkg/models/querybuilder_performer.go
Original file line number Diff line number Diff line change
Expand Up @@ -113,11 +113,12 @@ func (qb *PerformerQueryBuilder) Query(performerFilter *PerformerFilterType, fin
findFilter = &FindFilterType{}
}

tableName := "performers"
query := queryBuilder{
tableName: "performers",
tableName: tableName,
}

query.body = selectDistinctIDs("performers")
query.body = selectDistinctIDs(tableName)
query.body += `
left join performers_scenes as scenes_join on scenes_join.performer_id = performers.id
left join scenes on scenes_join.scene_id = scenes.id
Expand Down Expand Up @@ -152,18 +153,18 @@ func (qb *PerformerQueryBuilder) Query(performerFilter *PerformerFilterType, fin
query.addArg(thisArgs...)
}

handleStringCriterion("ethnicity", performerFilter.Ethnicity, &query)
handleStringCriterion("country", performerFilter.Country, &query)
handleStringCriterion("eye_color", performerFilter.EyeColor, &query)
handleStringCriterion("height", performerFilter.Height, &query)
handleStringCriterion("measurements", performerFilter.Measurements, &query)
handleStringCriterion("fake_tits", performerFilter.FakeTits, &query)
handleStringCriterion("career_length", performerFilter.CareerLength, &query)
handleStringCriterion("tattoos", performerFilter.Tattoos, &query)
handleStringCriterion("piercings", performerFilter.Piercings, &query)
handleStringCriterion(tableName+".ethnicity", performerFilter.Ethnicity, &query)
handleStringCriterion(tableName+".country", performerFilter.Country, &query)
handleStringCriterion(tableName+".eye_color", performerFilter.EyeColor, &query)
handleStringCriterion(tableName+".height", performerFilter.Height, &query)
handleStringCriterion(tableName+".measurements", performerFilter.Measurements, &query)
handleStringCriterion(tableName+".fake_tits", performerFilter.FakeTits, &query)
handleStringCriterion(tableName+".career_length", performerFilter.CareerLength, &query)
handleStringCriterion(tableName+".tattoos", performerFilter.Tattoos, &query)
handleStringCriterion(tableName+".piercings", performerFilter.Piercings, &query)

// TODO - need better handling of aliases
handleStringCriterion("aliases", performerFilter.Aliases, &query)
handleStringCriterion(tableName+".aliases", performerFilter.Aliases, &query)

query.sortAndPagination = qb.getPerformerSort(findFilter) + getPagination(findFilter)
idsResult, countResult := query.executeFind()
Expand Down