From fee89c4afdde4dacee51a763bc4d931320a9d69d Mon Sep 17 00:00:00 2001 From: dec05eba Date: Tue, 15 Jun 2021 09:28:35 +0200 Subject: Add all items starting at start-after to the download list in the data json file. This makes downloading more robust if title/url is changes for any item --- src/rss_html_common.h | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'src/rss_html_common.h') diff --git a/src/rss_html_common.h b/src/rss_html_common.h index 085ddc1..cc22b24 100644 --- a/src/rss_html_common.h +++ b/src/rss_html_common.h @@ -1,6 +1,8 @@ #ifndef RSS_HTML_COMMON_H #define RSS_HTML_COMMON_H +#include + #define MAX_UPDATE_ITEMS 10 typedef struct cJSON cJSON; @@ -11,20 +13,18 @@ typedef struct { } DownloadItemsData; typedef struct { - char *title; - char *link; + const char *title; + const char *link; cJSON *json_data; } TrackedItem; -int write_plugin_json_to_file(const char *dir, const char *filename, const char *url, const char *updated, const char *start_after, const char *start_after_url, const char *plugin_name); +int write_plugin_json_to_file(const char *dir, const char *filename, const char *url, const char *updated, DownloadItemsData *prev_download_items, size_t num_prev_download_items, const char *plugin_name); -/* - @num_download_items can't be more than MAX_UPDATE_ITEMS. - @filenames can be NULL, in which case filenames are not stored for items. This is the case for html items. -*/ /* Note: tracked_item.json_data becomes invalid after this call. + @filenames can be NULL, in which case filenames are not stored for items. This is the case for html items. @tracked_dir is also modified and then restored at the end. + @download_items and @timestamps both need to be @num_download_items long. If @filenames is not NULL, then it also has to be @num_download_items long. */ int tracked_item_update_latest(TrackedItem *tracked_item, char *tracked_dir, DownloadItemsData **download_items, char **filenames, long *timestamps, int num_download_items); -- cgit v1.2.3