diff options
author | default <nobody@localhost> | 2022-12-02 21:19:46 +0100 |
---|---|---|
committer | default <nobody@localhost> | 2022-12-02 21:19:46 +0100 |
commit | 0c525335ee222ef0d9145cb6aafa8e1da34ff756 (patch) | |
tree | 12beb70208f07f7047c755cb7cbfffaac9425c4c | |
parent | 908e068e36966b3d96a6a61bce4548fdc32cb5c7 (diff) |
New function object_here_by_md5().
-rw-r--r-- | data.c | 13 |
1 files changed, 9 insertions, 4 deletions
@@ -411,11 +411,18 @@ d_char *_object_fn(const char *id) } +int object_here_by_md5(char *id) +/* checks if an object is already downloaded */ +{ + xs *fn = _object_fn_by_md5(id); + return mtime(fn) > 0.0; +} + + int object_here(char *id) /* checks if an object is already downloaded */ { xs *fn = _object_fn(id); - return mtime(fn) > 0.0; } @@ -818,10 +825,8 @@ d_char *timeline_top_level(d_char *list) if (!object_parent(line, line2, sizeof(line2))) break; - xs *pfn = _object_fn_by_md5(line2); - /* well, there is a parent... but if it's not there, use this */ - if (mtime(pfn) == 0.0) + if (!object_here_by_md5(line2)) break; /* it's here! try again with its own parent */ |