diff options
author | dec05eba <dec05eba@protonmail.com> | 2020-07-27 20:14:05 +0200 |
---|---|---|
committer | dec05eba <dec05eba@protonmail.com> | 2020-07-27 20:14:05 +0200 |
commit | ec5e3c06084ef9c4b7fd71e4bb04af3fbe77bed9 (patch) | |
tree | deb399105f1d752d8f97f13138ab9ad354df4bbd /src/html.c | |
parent | 01a6bc67e70600680a1bbf6b9b5d102192760ae4 (diff) |
Time of html items in json file should be the time of download finished, not the time of start of all downloads
Diffstat (limited to 'src/html.c')
-rw-r--r-- | src/html.c | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -335,6 +335,7 @@ static int plugin_list_sync_callback(const char *name, const char *url, void *us static int download_html_items_in_reverse(const char *plugin_filepath, Buffer *download_items_buffer, TrackedHtml *tracked_html, char *html_tracked_dir, const char *download_dir) { int result = 0; DownloadItemsData *added_download_items[MAX_UPDATE_ITEMS]; + long timestamps[MAX_UPDATE_ITEMS]; char item_dir[PATH_MAX]; const char *path_components[] = { download_dir, tracked_html->title }; @@ -375,6 +376,7 @@ static int download_html_items_in_reverse(const char *plugin_filepath, Buffer *d break; added_download_items[download_item_index] = download_items_it; + timestamps[download_item_index] = time(NULL); ++download_item_index; } @@ -382,7 +384,7 @@ static int download_html_items_in_reverse(const char *plugin_filepath, Buffer *d tracked_item.title = tracked_html->title; tracked_item.link = tracked_html->link; tracked_item.json_data = tracked_html->json_data; - result = tracked_item_update_latest(&tracked_item, html_tracked_dir, added_download_items, NULL, download_item_index); + result = tracked_item_update_latest(&tracked_item, html_tracked_dir, added_download_items, NULL, timestamps, download_item_index); buffer_deinit(&json_element_buffer); return result; |