B-B-Lee Posted September 23 Share Posted September 23 (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 September 23 by B-B-Lee Quote Link to comment Share on other sites More sharing options...
JoeViking245 Posted September 23 Share Posted September 23 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. Quote Link to comment Share on other sites More sharing options...
B-B-Lee Posted September 23 Author Share Posted September 23 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. 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.