dlight.c: Mark item in download history earlier.
It is more correct to mark an item as downloaded right after it is actually fetched and not after it is successfully written to disk.
This commit is contained in:
parent
365b657f9f
commit
d49b1b2456
1 changed files with 4 additions and 2 deletions
6
dlight.c
6
dlight.c
|
|
@ -53,14 +53,16 @@ static void process_items(rss_t rss, struct target *t) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* save file to disk. */
|
/* At this point, mark the item as downloaded.
|
||||||
|
Even if we encounter an error while saving to disk. */
|
||||||
|
dlhist_mark(item.title, filter->dest);
|
||||||
|
|
||||||
if (write_http_file(file, filter->dest) < 0)
|
if (write_http_file(file, filter->dest) < 0)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
printf("Downloaded: %s (%s) to %s\n",
|
printf("Downloaded: %s (%s) to %s\n",
|
||||||
item.title, item.link, filter->dest);
|
item.title, item.link, filter->dest);
|
||||||
|
|
||||||
dlhist_mark(item.title, filter->dest);
|
|
||||||
proc_cache_update(item.link);
|
proc_cache_update(item.link);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Reference in a new issue