[Updated] Iconizer Database: Online or offline?
Added 2020-02-25 11:56:20 +0000 UTCHey guys,
decision time! There are things that are bothering me about the current Iconizer implementation:
a) the icon database is freaking huge, even while it's just a simple text lookup DB, every client needs to download that and that could be improved
b) I manually created the name's list in the database by adding all possible items to characters on D&D Beyond and then analyzing the JSON to get the item names. New items won't get added, unless busy bees like fohwse finds then for us
c) The item "Shield" and the spell "Shield" are sharing the same icon, since it matches by name and not by name/type combination.
So I was wondering if I could replace the database included in the download with a simple query to my server instead, like: "Item A created, do you have an icon for that?" "Yes, that's the filename", or what would be even better: "That's the URL".
In order to do that, you would have to be fine with:
- playing online, that is connected to the internet (some of you might be like "Duh, it's Foundry, it has to be online!", but no, there are people that are using Foundry at home on TV or something like that, I needed to learn that people do have offline-friends, too!)
- the module would query my server, that is: "Calls home" on every item creation or update
On querying the server for an item and that item is unknown, this information could be added to the database - even while not having an item assigned to it, it is known and can be matched with a great looking icon afterwards.
Poll Time!
What do you prefer (please choose one answer)
Update
I put up a demo setup for querying icons from a webserver and found out at the very end that the way Foundry handles the registered hooks (e.g. when an Item is created) is incompatible with asynchronous calls to external services - I can do the call alright, but when I receive the error, the item is already created. So that's not a viable solution.
What i will implement into the next version though is the reporting of new item names, types and subTypes that are currently not in the database. This is the first step into a tiny webtool where everyone can easily assign icons to items still missing a suitable one and which is then feeding directly into the databases of Iconizer which are held locally. This will be an opt-in setting, so per default no queries are run to external services.