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

Merged
merged 2 commits into from
Oct 29, 2024

Conversation

randemgame
Copy link
Contributor

@randemgame randemgame commented Oct 19, 2024

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.

randemgame and others added 2 commits October 19, 2024 19:08
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
@WithoutPants WithoutPants added this to the Version 0.28.0 milestone Oct 29, 2024
@WithoutPants WithoutPants added the improvement Something needed tweaking. label Oct 29, 2024
@WithoutPants
Copy link
Collaborator

#3738 concerns updating the UpdatedAt field when a funscript is added to a file during scan. The solves part of the problem, but updating the scene when the file changes to add a funscript is probably not a simple or necessarily desirable change. It should update the file UpdatedAt field, and it should be easier to find updated files, but it's an entirely different change.

@WithoutPants WithoutPants merged commit 1b7e729 into stashapp:develop Oct 29, 2024
2 checks passed
@randemgame randemgame deleted the heatmap-gen-fixes branch November 1, 2024 21:25
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.

2 participants