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

WIP: Autotag Improvements #1927

Closed

Conversation

kermieisinthehouse
Copy link
Collaborator

WIP, it probably doesn't even build yet.

Final goal is to have:

  • A checkbox for tags to enable / disable eligibility to autotag. This is useful now that we have hierarchies, to avoid tagging Categories-of-Categories and the like. Might extend to studios/performers depending.
  • Memoization of compiled RE objects during an autotag run to save CPU
  • A dedicated query function for the autotag task that reduces necessary n+1 queries and sorts by ROWID instead of path, which is where 99% of the CPU goes during an autotag run
  • Indexes for that query so that autotag can scream

Current time to beat is about 2 weeks to autotag images on my instance.

@@ -12,6 +12,8 @@ type Tag {
gallery_count: Int # Resolver
performer_count: Int

allow_autotag: Int
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Naive question: why the Int and not Bool ? Probably requires a comment what it encodes in the GraphQL schema.

I know the database doesn't support bools directly, but chances are the sql.NullBool or a straight bool will work at that level too because of the way Scanner/Valuer works. In any case, I don't think we should let the database schema bleed through to the GraphQL layer.

Name string `db:"name" json:"name"` // TODO make schema not null
CreatedAt SQLiteTimestamp `db:"created_at" json:"created_at"`
UpdatedAt SQLiteTimestamp `db:"updated_at" json:"updated_at"`
AllowAutotag int `db:"allow_autotag" json:"allow_autotag"`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Try using a bool here. I think it encodes it to 0/1.

@@ -443,14 +444,13 @@ func performerStudiosCriterionHandler(qb *performerQueryBuilder, studios *models
if studios != nil {
var clauseCondition string

switch studios.Modifier {
case models.CriterionModifierIncludes:
if studios.Modifier == models.CriterionModifierIncludes {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The gocritic linter is likely to ask for a switch here.

@kermieisinthehouse kermieisinthehouse added the improvement Something needed tweaking. label Nov 1, 2021
@kermieisinthehouse kermieisinthehouse added this to the Version 0.12.0 milestone Nov 8, 2021
@WithoutPants WithoutPants removed this from the Version 0.12.0 milestone Dec 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
improvement Something needed tweaking.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants