knulli-cfw / distribution

Main KNULLI distribution
https://knulli.org
Other
390 stars 26 forks source link

"Clean Gamelists & Remove Unused Media" removes new media #95

Open martin-braun opened 2 months ago

martin-braun commented 2 months ago

Knulli build version

40-dev-d3b520f949 2024/07/21

Your architecture

RG35XX

Issue description

If I scrape data for a new game and run "Clean Gamelists & Remove Unused Media" afterwards, the images and videos from that game get deleted again.

Only if I restart the system, those data is persisted. This however shouldn't be necessary.

Detailed reproduction steps

Details of any attempts to fix this yourself

Restarting after scraping anything really helps to not have this happening, but it's sub-optimal.

Details of any modifications you have made to Knulli.

I really just setup SSH and Syncthing. I can also see how the files are created after scraping, but then get deleted again when running "Clean Gamelists & Remove Unused Media".

Logs and data

No response

HoroTW commented 2 months ago

For what its worth it should also not happen when you do the following:

But I see that it would be good to trigger a meta data update after the scrape.

martin-braun commented 2 months ago

@HoroTW Ah so "Update Gamelist" writes the gamelist.xml files from the data in memory and "Clean Gamelists & Remove Unused Media" probably parses the gamelist.xml and some scraped data might not be serialized in that spot when "Update Gamelist" is not called.

That's so hard to understand, intuitively. I'm a software engineer and it took me a while to understand what is happening in the background. Also the fact, that I cannot edit gamelist.xml files on another device without disabling the saving of metadata when shutting off the system, because it would overwrite my gamelist.xml from memory when I restart the device, which would be necessary to load any changes I made from another device I sync to.

My suggestion

HoroTW commented 2 months ago

I agree and can see how this is not intuitive! I also only inferred it because of the following settings/behaviors:

I think a PR to the wiki adding a description of this behavior/operation principle would be welcome :wink: Your second point would probably also be a nice addition, I'd argue that this could be expected behavior, so yeah, I'm for it! 😊