Skip to content
Snippets Groups Projects
Commit ab0b77e8 authored by Guillaume Benoit's avatar Guillaume Benoit
Browse files

refresh aur db only when needed

parent 59a2db6f
No related branches found
No related tags found
No related merge requests found
......@@ -397,6 +397,12 @@ namespace Pamac {
var emit_timer = new Timer ();
try {
var message = new Soup.Message ("GET", url);
if (force == 0 && destfile.query_exists ()) {
// start from scratch only download if our local is out of date.
FileInfo info = destfile.query_info (FileAttribute.TIME_MODIFIED, FileQueryInfoFlags.NONE);
DateTime time = info.get_modification_date_time ();
message.request_headers.append ("If-Modified-Since", Soup.date_time_to_string (time, Soup.DateFormat.HTTP));
}
if (tempfile.query_exists ()) {
// removing partial download
tempfile.delete ();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment