Jump to content
LaunchBox Community Forums

Recommended Posts

Posted (edited)

Hi, since I had no answers to my request for a more strict way to update metadata (see https://forums.launchbox-app.com/topic/86493-update-metadata-messing-things-up-when-a-game-is-not-on-db-can-i-force-a-strict-scrape/ for the request) I thought to dive into plugins development to do my own "strict scraper".

While I was experimenting with the available interface I did some nice "DYI" tool to organize and rename my collection C64 games to make my clean up work easier and I'm almost ready to give a try to my scraper and I was wondering: is there an already available interface or helper to navigare or scan the LB DB (XML files under the "metadata" folder) or should I parse the XML files as regular XML all by myself? No problem in doing it by myself, but I'd be happy if someone can point me to some easier way, 'cause the time I can put into that is extremely scarse.

Thank you very much for the help!   

Edited by B-B-Lee
Posted

The raw data in the xml is not available via the API.  (At least not that I've seen)

Depending on how your plugin needs to access the data (a little each time you load it [i.e. one game at a time] or potentially a lot [i.e. load a platform and go through several games]), you may want to consider loading the xml into an object (model) when you open the plugin. Then just access the model [in memory].  The initial loading into the model may take a few seconds, but then accessing the data in the model is near instantaneous.  Where-as parsing the xml each time, for each game, could still be 'fast', it would create a lot of 'excess' disk access.    Just a thought.

Posted

Thanks for the answer!
Yeah, I'm going to operate on a selection (it could be a 35000 games selection, so a big one), so my idea was to load it once and then parse it via xpath while going through the selection, thank you for confirming the approach!
I'll make it available to everyone if there's someone that can find it useful.

  • Game On 1

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...