eXaminator / kanka-foundry

FoundryVTT module to import information from kanka.io
MIT License
22 stars 8 forks source link

One master sync button #46

Closed jonepatr closed 3 years ago

jonepatr commented 3 years ago

Currently there is a button for updating outdated, and then each category has a linking/update buttons. Would be nice with one button which just syncs everything.

eXaminator commented 3 years ago

Hi @jonepatr,

there are 2 reasons I haven't done this yet:

  1. I felt that GMs usually want some control of what gets synced and what doesn't, especially since a large number of entries (not just in the journal but also Actors, Items etc.) can slow down Foundry on startup because everything has to be downloaded (that's why foundry has compendiums, which aren't downloaded on startup).
  2. I'm always concerned about the number of requests the module has to make to the Kanka API with a timeframe of 60 seconds, because there is a rate limit in place that forbids more than 30 requests (I think 90 for subscribers) per minute. That being said, I usually don't load every entity individually, so this should only be a concern for pretty large campaigns (I'd say upwards of 1000 entities, but it depends on different factors).

I'll look into this, it shouldn't be hard to implement in general. So I'll probably add this sometime soon.

jonepatr commented 3 years ago

One option could be to sync in the background and notify the user when the sync is done through a notification. That way the time it takes and the rate limit is not as noticable. The kanka-foundry window could have a percentage showing how much of the content is synced, so that if you have a really big kanka campaign you can actually see that things are happening, but if it's relatively small it should happen almost instantenously.

eXaminator commented 3 years ago

I have thought about a progress bar before. I have even build a small debug tool in the module that shows the current rate limit at all times (though only in debug mode, to help me in development). I have marked this feature for 2.1.0 as I intend to implemented it (once I have more time so spend on this).

github-actions[bot] commented 3 years ago

:tada: This issue has been resolved in version 2.1.0 :tada:

The release is available on GitHub release

Your semantic-release bot :package::rocket: