#include <json/json.h>
#include "cache.h"
+#include "fcache.h"
#include "list.h"
#include "log.h"
#include "lp_ws.h"
{
json_object *obj;
const struct distro_arch_series *distro;
+ char *content;
distro = cache_get(url);
if (distro)
return (struct distro_arch_series *)distro;
- obj = get_json_object(url);
+ content = fcache_get(url + 7);
+ if (!content) {
+ content = fetch_url(url);
+ if (content)
+ fcache_put(url + 7, content);
+ else
+ return NULL;
+ }
+
+ obj = json_tokener_parse(content);
+
+ free(content);
if (!obj)
return NULL;