X-Git-Url: http://git.wpitchoune.net/gitweb/?a=blobdiff_plain;f=src%2Fppastats.c;h=7d67bc44723f1651c73d12530d7193aca5094bc7;hb=12b0e2c57c55b4d3086ef920deda5400016339f2;hp=4d8b874499127c71c8d51ca1120ce08a0b04e013;hpb=c1699160bcf64cf0b559c713a22720183a9f8934;p=ppastats.git diff --git a/src/ppastats.c b/src/ppastats.c index 4d8b874..7d67bc4 100644 --- a/src/ppastats.c +++ b/src/ppastats.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2011-2012 jeanfi@gmail.com + * Copyright (C) 2011-2014 jeanfi@gmail.com * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as @@ -25,8 +25,8 @@ #include #include "list.h" -#include "log.h" #include "lp_ws.h" +#include #include "ppastats.h" static struct package_stats *get_package_stats(struct ppa_stats *stats, @@ -231,7 +231,8 @@ pkg_add_distro(struct package_stats *pkg, struct ppa_stats * create_ppa_stats(const char *owner, const char *ppa_name, - const char *package_status) + const char *package_status, + int ws_size) { struct ppa_stats *ppa; struct bpph **history, **h_cur, *h; @@ -246,7 +247,7 @@ create_ppa_stats(const char *owner, struct daily_download_total **totals; ppa_url = get_archive_url(owner, ppa_name); - history = get_bpph_list(ppa_url, package_status); + history = get_bpph_list(ppa_url, package_status, ws_size); free(ppa_url); if (!history) { @@ -269,12 +270,7 @@ create_ppa_stats(const char *owner, h->self_link); continue; } - count = get_download_count(h->self_link); - if (count == -1) { - log_err(_("Failed to retrieve download count for %s"), - h->self_link); - count = 0; - } + count = ddts_get_count(totals); pkg_name = h->binary_package_name; pkg_version = h->binary_package_version; arch_series