public bool UpdateDownloadEntry(FinishedDownloadItem entry) { lock (db) { try { if (cmdUpdateOne == null) { cmdUpdateOne = new SQLiteCommand(@"UPDATE downloads SET name=@name, date_added=@date_added, size=@size, download_type=@download_type, targetdir=@targetdir, primary_url=@primary_url, auth=@auth, user=@user, pass=@pass, proxy=@proxy, proxy_host=@proxy_host, proxy_port=@proxy_port, proxy_user=@proxy_user, proxy_pass=@proxy_pass, proxy_type=@proxy_type WHERE id=@id", db); } SetParam("@id", entry.Id, cmdUpdateOne.Parameters); SetParam("@name", entry.Name, cmdUpdateOne.Parameters); SetParam("@date_added", entry.DateAdded.ToBinary(), cmdUpdateOne.Parameters); SetParam("@size", entry.Size, cmdUpdateOne.Parameters); SetParam("@download_type", entry.DownloadType, cmdUpdateOne.Parameters); SetParam("@primary_url", entry.PrimaryUrl, cmdUpdateOne.Parameters); SetParam("@auth", entry.Authentication.HasValue ? 1 : 0, cmdUpdateOne.Parameters); SetParam("@user", entry.Authentication?.UserName ?? null, cmdUpdateOne.Parameters); SetParam("@pass", entry.Authentication?.Password ?? null, cmdUpdateOne.Parameters); SetParam("@proxy", (int)(entry.Proxy?.ProxyType ?? 0), cmdUpdateOne.Parameters); SetParam("@proxy_host", entry.Proxy?.Host ?? null, cmdUpdateOne.Parameters); SetParam("@proxy_port", (int)(entry.Proxy?.Port ?? 0), cmdUpdateOne.Parameters); SetParam("@proxy_user", entry.Proxy?.UserName ?? null, cmdUpdateOne.Parameters); SetParam("@proxy_pass", entry.Proxy?.Password ?? null, cmdUpdateOne.Parameters); SetParam("@proxy_type", 1, cmdUpdateOne.Parameters); SetParam("@targetdir", entry.TargetDir, cmdUpdateOne.Parameters); cmdUpdateOne.ExecuteNonQuery(); return(true); } catch (Exception ex) { Log.Debug(ex, ex.Message); return(false); } } }
public FinishedDownloadEntryWrapper(FinishedDownloadItem entry) { this.entry = entry; }
public FinishedEntryWrapper(FinishedDownloadItem entry, TreeIter treeIter, ITreeModel store) { this.entry = entry; this.treeIter = treeIter; this.store = store; }