public DownloadItem Add(EpisodeWithDownloadSettings ep, string template, string downloadpath,DownloadStatus status=DownloadStatus.Queue)
{
DownloadItem dinfo = null;
lock (_downloadslock)
{
dinfo = new DownloadItem(ep, template, downloadpath, this, status);
dinfo.Index = cnt++;
dinfo.OnProgress += ((a) =>
{
if (OnProgress != null)
OnProgress(a);
});
dinfo.OnFinish += ((a) =>
{
Save();
CheckForDownload();
});
lock (_downloadslock)
{
_downloads.Add(dinfo);
}
}
CheckForDownload();
return dinfo;
}