Skip to content

Conversation

@Gykes
Copy link
Collaborator

@Gykes Gykes commented Dec 22, 2025

This is my first attempt at a pretty large front and backend change PR. Please be gentle.

Adds career_start and career_end integer fields to the Performer model, aligning with StashDB's format. The existing career_length string field is now deprecated and computed from the new fields for backwards compatibility.

Closes: #3348

Changes

  • Added migration 76_performer_career_dates.up.sql to add career_start and career_end integer columns to the performers table
  • Updated appSchemaVersion to 76

GraphQL Schema

  • Added career_start Int and career_end Int fields to:
    • Performer type
    • PerformerCreateInput
    • PerformerUpdateInput
    • BulkPerformerUpdateInput
    • ScrapedPerformer type
    • ScrapedPerformerInput
  • Deprecated career_length field with reason "Use career_start and career_end"

Backend

  • Added CareerStart and CareerEnd fields to:
    • Performer model struct
    • PerformerPartial struct
    • performerRow SQLite struct
    • ScrapedPerformer struct
  • Added CareerLength resolver that computes the display string from career_start and career_end, with fallback to stored career_length for backwards compatibility
  • Updated mutation resolvers to handle new fields in create/update operations
  • Updated ToPerformer method to convert scraped string values to integers

Frontend

  • Removed career_length input field from PerformerEditPanel
  • Added career_start and career_end number input fields to PerformerEditPanel
  • Updated PerformerScrapeDialog to show career_start and career_end instead of career_length
  • Updated Tagger PerformerModal to display and save career_start and career_end
  • Updated scraper GraphQL fragments to request new fields
  • Added localization strings for career_start and career_end

StashBox Integration

  • Updated performerFragmentToScrapedPerformer to populate CareerStart and CareerEnd from StashDB's CareerStartYear and CareerEndYear
  • Updated SubmitPerformerDraft to use CareerStart and CareerEnd directly when submitting to StashBox, with fallback to parsing CareerLength for backwards compatibility

Backwards Compatibility

  • Existing performers with only career_length populated will continue to display correctly via the resolver fallback
  • The career_length field remains in the GraphQL API (deprecated) and is computed from the new fields when available
  • StashBox scraping now populates the new fields directly

@Gykes Gykes added the needs testing Pull requests that require testing label Dec 22, 2025
@discourse-stashapp
Copy link

This pull request has been mentioned on Stash. There might be relevant details there:

https://discourse.stashapp.cc/t/stash-v0-31-release-development-thread/4881/1

@Gykes Gykes added this to the Version 0.31.0 milestone Dec 23, 2025
@WithoutPants
Copy link
Collaborator

  • Added migration 76_performer_career_dates.up.sql to add career_start and career_end integer columns to the performers table

The migration should migrate existing career_length values into the new fields. This will likely require a post-migration to interpret the original fields. The post-migration should remove the existing career_length field. If the existing value cannot be parsed into start and end, then it should be logged and moved into a career_length custom attribute.

The mutation resolvers need to interpret the deprecated career_length fields and set the appropriate new fields.

The import/export functionality needs to be updated with the new fields and handle the legacy field.

@Gykes
Copy link
Collaborator Author

Gykes commented Jan 13, 2026

Honestly, I didn't even know you could do a post migration like that. I was curious how we were going to handle moving the data to the new field without having to have users retag all their stuff. Will more than likely start working on stuff tomorrow. Thanks for the info 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs testing Pull requests that require testing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature] Change Career Length to 2 fields

3 participants