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

Update Scenes' 'Updated At' Date on Heatmap Gen & Expand Error Log #5401

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

randemgame
Copy link
Contributor

The "Updated At" field of a Scene will now update when an associated Heatmap is created via the Generate task..

I am not sure whether a Scene's 'Update At' would be better updated:

  • when the 'File Info' is updated with some generated funscript data during the Scan task
  • when the heatmap is attached to a scene during the Generate task
    at the moment it is neither. perhaps it could be both? but it should at least be one.

see this long-standing issue #3738 about why this functionality is needed, which this PR will close.

If necessary I can work to move this functionality from the Generate to the Scan task. I attempted that at first, tracing where a Scene's 'Update At' property could be modified as a result of the scan.go message about 'Updating Metadata'. I thought that the best trigger for this may be when a Scene's 'Interactive' property is modified there, but I could not work it out.

I was very surprised by the simplicity of the solution in this PR but I am not a go developer so blind to any issues or offenses I could have included here. I am not sure if the error messaging in the code I added is necessary or not and I was told 'I settled on a simplified error messaging due to this function not being so critical', but I really have no idea what I'm doing.


Sorry to include a second thing, but I happened to notice that this file also included the same error message which has been frustrating me for a long time. In my logs after any Generate task I would keep seeing the following, filling up 40 or more lines of text:
"error generating heatmap: json: cannot unmarshal number into Go struct field Script.version of type string"
including the Scene Path in this error message has made it possible for me to identify those problem scripts lost in my library.

The UpdatedAt field of a scene is now correctly updated after Generate Task is run and a heatmap linked to a scene.. I thought it made more sense here in the generate heatmap compared to scan.go, owing to funscript data not being tracked/stored in a typical sense with the scan message "updating metadata".
I used a simplified error messaging as I did not think it was critcal but I do not know if did not use the correct code structure
If updating the UpdatedAt field should be done there when the file is marked as interactive I can try and do that?
This would fix this long-standing issue stashapp#3738

The error message change is useful as I could not tell which scripts were causing errors before but now it is clear in the logs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant