aboutsummaryrefslogtreecommitdiff
path: root/src/rss_html_common.c
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2020-09-27 02:56:13 +0200
committerdec05eba <dec05eba@protonmail.com>2020-09-27 03:29:34 +0200
commita0707a1cf4583f7f00a6fbce2f50fecd09ca7be0 (patch)
tree88bbe0668f1326087a991fc10af9ff5295936ac1 /src/rss_html_common.c
parent836eda9a772ae91a76adffaadfe098bcc82d4d3d (diff)
Fix multiple items using the same timestamp if updated at the same time
They should use their download finished time instead
Diffstat (limited to 'src/rss_html_common.c')
-rw-r--r--src/rss_html_common.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/rss_html_common.c b/src/rss_html_common.c
index e383117..168195e 100644
--- a/src/rss_html_common.c
+++ b/src/rss_html_common.c
@@ -254,6 +254,8 @@ int tracked_item_update_latest(TrackedItem *tracked_item, char *tracked_dir, Dow
struct json_value_s new_downloaded_json_val[MAX_UPDATE_ITEMS];
struct json_array_element_s new_downloaded_item_element[MAX_UPDATE_ITEMS];
+ char items_timestamps[MAX_UPDATE_ITEMS][32];
+
struct json_array_element_s *last_downloaded_element = NULL;
for(int i = 0; i < num_download_items; ++i) {
create_json_string(&title_json_value_str[i], download_items[i]->title, strlen(download_items[i]->title));
@@ -264,9 +266,9 @@ int tracked_item_update_latest(TrackedItem *tracked_item, char *tracked_dir, Dow
init_json_value_str(&filename_json_value[i], &filename_json_value_str[i]);
}
- sprintf(updated, "%ld", timestamps[i]);
- int updated_len = strlen(updated);
- create_json_string(&time_value_str[i], updated, updated_len);
+ sprintf(items_timestamps[i], "%ld", timestamps[i]);
+ int updated_len = strlen(items_timestamps[i]);
+ create_json_string(&time_value_str[i], items_timestamps[i], updated_len);
init_json_value_str(&time_json_value[i], &time_value_str[i]);
create_json_string(&url_value_str[i], download_items[i]->link, strlen(download_items[i]->link));