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

[Bug Report] Performer checksum not updated on rename #2344

Closed
DampToast opened this issue Feb 24, 2022 · 3 comments · Fixed by #2345
Closed

[Bug Report] Performer checksum not updated on rename #2344

DampToast opened this issue Feb 24, 2022 · 3 comments · Fixed by #2345
Labels
bug Something isn't working

Comments

@DampToast
Copy link
Contributor

DampToast commented Feb 24, 2022

Edit: You can probably not bother reading this first post, but I'll leave it here in case there's useful info in it. Steps to reproduce are in the 2nd post and proposed fix in 3rd.

Describe the bug
I am trying to create a performer with the name "Simon" but I am getting an error "UNIQUE constraint failed: performers.checksum". I looked for performers with the name "Simon" using the regex "(?i)^simon$" and nobody shows up.

I did some data base looking and it looks like the hash matches to a performer "Simon Kitty". I looked in the app code to see what it was building the hash off of and it looked like an md5 hash off the full name. I did note that I currently have an alias of 'Simon' among others for that performer.

I did some verification that changing the performers name via the UI does change their hash. I changed "Simon Kitty" to something else, then change it back, and her name hash changed. I also noticed this with another performer but just assigned that scene to their a duplicate I had of them under another name that they would have been merged to anyway.

To Reproduce
Steps to reproduce the behavior:
Not sure. I might do some digging and see which performer names, when I rehash them, don't match the hash in the database. Of note, the two performers that were clashing are tagged with StashDB and I did refresh them this morning. So maybe the stashdb sync did something. I'm almost positive these performers were matched to StashDB during scene tagging.

Stash Version: (from Settings -> About):
v0.12.0-68-g299d59b5

I'll likely investigate this tonight, just wanted it here in case I forget.

@DampToast DampToast added the help wanted Extra attention is needed label Feb 24, 2022
@DampToast
Copy link
Contributor Author

Okay I am 99% sure this is what is going on.

  1. Create a performer named "Aali Rousseau". No other info needed.
  2. Go to tag view in performer, and search StashDB for her. It should return "Aali Kali". Select that as the match and save.
  3. Limit your Performer view down to "Aali Rousseau". Then "Batch Update" with "Current Page" and "Refresh Tagged Performers". Execute that.
  4. Her name is now changed to "Aali Kali" but her checksum did not get updated. You cannot create a new performer with the name "Aali Rousseau" because of this but you can create a new performer with the name "Aali Kali".

@DampToast
Copy link
Contributor Author

DampToast commented Feb 24, 2022

I think the fix to prevent this is probably needed at:
https://github.com/stashapp/stash/blob/develop/pkg/manager/task_stash_box_tag.go#L135

Should be pretty simple putting the md5 of the name into checksum. However there will also have to be something done when people update to the next version of Stash that redoes the relevant (a full sweep is fine I'd guess) performer MD5s and deals with conflicts since they can have two performers with the same name via the route I described. I'm not sure how to do that bit. Honestly I'd just put something like ' - [RENAMED]' at the end of performers that clash and let people fix it afterwards, making note of it in the patch area.

@WithoutPants
Copy link
Collaborator

I think the way forward is to remove checksum entirely from performers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants