Skip to content

Commit 89428f6

Browse files
added needs_Lastrefresh -- optimizing requires extra check.. :(
1 parent 94c9c6b commit 89428f6

File tree

1 file changed

+16
-2
lines changed

1 file changed

+16
-2
lines changed

src/Controls/CircularDownloadProgress.cs

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,24 @@ private void Tmr_downloader_Tick(object sender, EventArgs e)
4040
{
4141

4242
bool isDownloading=false;
43-
try { isDownloading = DownloadManager.DownloadsInProgress(); }
43+
bool needs_lastRefresh=false;
44+
try
45+
{
46+
isDownloading = DownloadManager.DownloadsInProgress();
47+
if (!isDownloading)
48+
{
49+
var curdlitemKV_val = DownloadManager.Downloads
50+
.Where(x => DateTime.Now.Subtract( x.Value.EndTime ?? DateTime.MinValue).TotalSeconds <3 )
51+
.Select(x=>x.Value)
52+
.FirstOrDefault();
53+
//var curdlitem = curdlitemKV.Value;
54+
if(curdlitemKV_val != null)
55+
needs_lastRefresh = true;
56+
}
57+
}
4458
catch (Exception ex) { }
4559

46-
if (isDownloading)
60+
if (isDownloading || needs_lastRefresh)
4761
_btnDL.Refresh();
4862

4963
//BtnDownloads.Invalidate();

0 commit comments

Comments
 (0)