aboutsummaryrefslogtreecommitdiff
path: root/src/rss.c
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2020-07-27 20:14:05 +0200
committerdec05eba <dec05eba@protonmail.com>2020-07-27 20:14:05 +0200
commitec5e3c06084ef9c4b7fd71e4bb04af3fbe77bed9 (patch)
treedeb399105f1d752d8f97f13138ab9ad354df4bbd /src/rss.c
parent01a6bc67e70600680a1bbf6b9b5d102192760ae4 (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/rss.c')
-rw-r--r--src/rss.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/rss.c b/src/rss.c
index 0e7647e..0f3aafd 100644
--- a/src/rss.c
+++ b/src/rss.c
@@ -470,6 +470,7 @@ static int add_torrents_in_reverse(TransmissionSession *transmission_session, Bu
int result = 0;
char *torrent_names[MAX_UPDATE_ITEMS];
DownloadItemsData *added_download_items[MAX_UPDATE_ITEMS];
+ long timestamps[MAX_UPDATE_ITEMS];
Buffer json_element_buffer;
buffer_init(&json_element_buffer);
@@ -487,6 +488,7 @@ static int add_torrents_in_reverse(TransmissionSession *transmission_session, Bu
break;
}
added_download_items[torrent_name_index] = download_items_it;
+ timestamps[torrent_name_index] = time(NULL);
++torrent_name_index;
/* Show notification that download has started? */
}
@@ -495,7 +497,7 @@ static int add_torrents_in_reverse(TransmissionSession *transmission_session, Bu
tracked_item.title = tracked_rss->title;
tracked_item.link = tracked_rss->link;
tracked_item.json_data = tracked_rss->json_data;
- result = tracked_item_update_latest(&tracked_item, rss_tracked_dir, added_download_items, torrent_names, torrent_name_index);
+ result = tracked_item_update_latest(&tracked_item, rss_tracked_dir, added_download_items, torrent_names, timestamps, torrent_name_index);
for(int i = 0; i < torrent_name_index; ++i) {
free(torrent_names[i]);