diff options
author | dec05eba <dec05eba@protonmail.com> | 2021-06-15 09:28:35 +0200 |
---|---|---|
committer | dec05eba <dec05eba@protonmail.com> | 2021-06-15 09:28:46 +0200 |
commit | fee89c4afdde4dacee51a763bc4d931320a9d69d (patch) | |
tree | 66a0accb86934e76ad245d6e57dc4a3fb6cfd63f /src/rss_html_common.h | |
parent | 3757fe80b30801119bda41ab0445e915271129fc (diff) |
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
Diffstat (limited to 'src/rss_html_common.h')
-rw-r--r-- | src/rss_html_common.h | 14 |
1 files changed, 7 insertions, 7 deletions
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 <stddef.h> + #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); |