Enabling disk_cache can lead to an exception (invalid_index) when changing channel:
Invalid get index 'badge_sets' (on base 'Dictionary'). (gift_node.gd:525)
We short-circuit the get_badge_mapping (and also, as a side effect, we lower the ciclomatic complexity of the method) so that when there is a missing key the right thing happens.
This way we "return early" in the three cases: if it is cached on memory, if it is cached on disk, or if we have to retrieve it from Twitch/HTTPS.
Enabling disk_cache can lead to an exception (invalid_index) when changing channel:
Invalid get index 'badge_sets' (on base 'Dictionary'). (gift_node.gd:525)
We short-circuit the get_badge_mapping (and also, as a side effect, we lower the ciclomatic complexity of the method) so that when there is a missing key the right thing happens.
This way we "return early" in the three cases: if it is cached on memory, if it is cached on disk, or if we have to retrieve it from Twitch/HTTPS.
Fixes #25