Skip to content

Commit

Permalink
Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
Anon247 committed Apr 3, 2020
1 parent 29c9da3 commit 5703a68
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 43 deletions.
30 changes: 0 additions & 30 deletions pkg/models/querybuilder_performer.go
Original file line number Diff line number Diff line change
Expand Up @@ -160,36 +160,6 @@ func (qb *PerformerQueryBuilder) Query(performerFilter *PerformerFilterType, fin

if isMissingFilter := performerFilter.IsMissing; isMissingFilter != nil && *isMissingFilter != "" {
switch *isMissingFilter {
case "image":
query.addWhere("performers.image IS NULL")
case "url":
query.addWhere("performers.url IS NULL")
case "twitter":
query.addWhere("performers.twitter IS NULL")
case "instagram":
query.addWhere("performers.instagram IS NULL")
case "ethnicity":
query.addWhere("performers.ethnicity IS NULL")
case "country":
query.addWhere("performers.country IS NULL")
case "eye_color":
query.addWhere("performers.eye_color IS NULL")
case "height":
query.addWhere("performers.height IS NULL")
case "measurements":
query.addWhere("performers.measurements IS NULL")
case "fake_tits":
query.addWhere("performers.fake_tits IS NULL")
case "career_length":
query.addWhere("performers.career_length IS NULL")
case "tattoos":
query.addWhere("performers.tattoos IS NULL")
case "piercings":
query.addWhere("performers.piercings IS NULL")
case "aliases":
query.addWhere("performers.aliases IS NULL")
case "gender":
query.addWhere("performers.gender IS NULL")
case "scenes":
query.addWhere("scenes_join.scene_id IS NULL")
default:
Expand Down
8 changes: 4 additions & 4 deletions ui/v2.5/src/models/list-filter/criteria/criterion.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ export type CriterionType =
| "duration"
| "favorite"
| "hasMarkers"
| "SceneIsMissing"
| "PerformerIsMissing"
| "sceneIsMissing"
| "performerIsMissing"
| "tags"
| "sceneTags"
| "performers"
Expand Down Expand Up @@ -53,9 +53,9 @@ export abstract class Criterion {
return "Favorite";
case "hasMarkers":
return "Has Markers";
case "SceneIsMissing":
case "sceneIsMissing":
return "Is Missing";
case "PerformerIsMissing":
case "performerIsMissing":
return "Is Missing";
case "tags":
return "Tags";
Expand Down
13 changes: 6 additions & 7 deletions ui/v2.5/src/models/list-filter/criteria/is-missing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { CriterionModifier } from "src/core/generated-graphql";
import { Criterion, CriterionType, ICriterionOption } from "./criterion";

export class SceneIsMissingCriterion extends Criterion {
public type: CriterionType = "SceneIsMissing";
public type: CriterionType = "sceneIsMissing";
public parameterName: string = "is_missing";
public modifier = CriterionModifier.Equals;
public modifierOptions = [];
Expand All @@ -19,17 +19,16 @@ export class SceneIsMissingCriterion extends Criterion {
}

export class SceneIsMissingCriterionOption implements ICriterionOption {
public label: string = Criterion.getLabel("SceneIsMissing");
public value: CriterionType = "SceneIsMissing";
public label: string = Criterion.getLabel("sceneIsMissing");
public value: CriterionType = "sceneIsMissing";
}

export class PerformerIsMissingCriterion extends Criterion {
public type: CriterionType = "PerformerIsMissing";
public type: CriterionType = "performerIsMissing";
public parameterName: string = "is_missing";
public modifier = CriterionModifier.Equals;
public modifierOptions = [];
public options: string[] = [
"image",
"url",
"twitter",
"instagram",
Expand All @@ -50,6 +49,6 @@ export class PerformerIsMissingCriterion extends Criterion {
}

export class PerformerIsMissingCriterionOption implements ICriterionOption {
public label: string = Criterion.getLabel("PerformerIsMissing");
public value: CriterionType = "PerformerIsMissing";
public label: string = Criterion.getLabel("performerIsMissing");
public value: CriterionType = "performerIsMissing";
}
4 changes: 2 additions & 2 deletions ui/v2.5/src/models/list-filter/criteria/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@ export function makeCriteria(type: CriterionType = "none") {
return new FavoriteCriterion();
case "hasMarkers":
return new HasMarkersCriterion();
case "SceneIsMissing":
case "sceneIsMissing":
return new SceneIsMissingCriterion();
case "PerformerIsMissing":
case "performerIsMissing":
return new PerformerIsMissingCriterion();
case "tags":
return new TagsCriterion("tags");
Expand Down

0 comments on commit 5703a68

Please sign in to comment.