From 7af26a45c101f29510ee2c56dc5159869f5b8266 Mon Sep 17 00:00:00 2001 From: eleksir Date: Mon, 23 Sep 2019 23:09:10 +0300 Subject: [PATCH] Download only if file absent --- lib/image_dl.pm | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/image_dl.pm b/lib/image_dl.pm index b3929ff..73f316c 100644 --- a/lib/image_dl.pm +++ b/lib/image_dl.pm @@ -113,7 +113,10 @@ sub __image_dl_subthread { $savepath = $c->{image_dl}->{dir} . "/" . $fname; } - __dlfunc($str, $savepath); + unless (-f $savepath) { + __dlfunc($str, $savepath); + } + undef $savepath; undef $fname; }