private static void ResumeDownloadsAsync()
{
List <int> epids = new List <int>();
lock (downloads)
{
using (SQLiteCommand command = new SQLiteCommand("select episodes.epid from downloads, episodes where downloads.epid=episodes.epid and status=@statuswait order by date", FetchDbConn()))
{
command.Parameters.Add(new SQLiteParameter("@statuswait", Model.Download.DownloadStatus.Waiting));
using (SQLiteMonDataReader reader = new SQLiteMonDataReader(command.ExecuteReader()))
{
int epidOrdinal = reader.GetOrdinal("epid");
while (reader.Read())
{
epids.Add(reader.GetInt32(epidOrdinal));
}
}
}
if (epids.Count > 0)
{
AddDownloads(epids.ToArray());
}
}
RetryErrored();
}