Exemple #1
0
        private void bnUTGo_Click(object sender, System.EventArgs e)
        {
            if (!this.CheckResumeDatPath())
            {
                return;
            }

            string searchFolder  = this.txtUTSearchFolder.Text;
            string resumeDatFile = TVSettings.Instance.ResumeDatPath;
            bool   testMode      = this.chkUTTest.Checked;

            if (!File.Exists(resumeDatFile))
            {
                return;
            }

            if (!testMode && !CheckUTorrentClosed())
            {
                return;
            }
            //
            //				 int action = actNone;
            //				 if (chkUTSearchSubfolders->Checked)
            //					 action |=  actSearchSubfolders;
            //
            //
            //
            //				 if ( (action & (actRename | actCopy | actMatchMissing | actHashSearch)) == 0 )
            //					 return;
            //

            this.lvUTResults.Items.Clear();

            BTResume btp = new BTResume(this.SetProg, resumeDatFile);

            List <string> sl = new List <String>();

            foreach (string torrent in this.lbUTTorrents.CheckedItems)
            {
                sl.Add(torrent);
            }

            btp.DoWork(sl, searchFolder, this.lvUTResults, this.cbUTUseHashing.Checked, this.cbUTMatchMissing.Checked, this.cbUTSetPrio.Checked,
                       testMode, this.chkUTSearchSubfolders.Checked, this.mDoc.TheActionList, TVSettings.Instance.FNPRegexs,
                       mDoc.Args);

            if (!testMode)
            {
                RestartUTorrent();
            }
        }
Exemple #2
0
        private void UpdateResumeDats()
        {
            string searchFolder = txtUTSearchFolder.Text;
            string resume_dir   = Path.Combine(Path.GetDirectoryName(TVSettings.Instance.ResumeDatPath), "resume_dir");
            bool   testMode     = chkUTTest.Checked;

            if (!Directory.Exists(resume_dir))
            {
                return;
            }

            if (!testMode && !CheckUTorrentClosed())
            {
                return;
            }

            lvUTResults.Items.Clear();

            List <string> sl    = new List <string>();
            List <string> files = new List <string>();

            foreach (string torrent in lbUTTorrents.CheckedItems)
            {
                sl.Add(Path.Combine(Path.GetDirectoryName(TVSettings.Instance.ResumeDatPath), torrent));
                foreach (var pair in ResumeDats)
                {
                    if (pair.Value == torrent)
                    {
                        files.Add(Path.Combine(resume_dir, pair.Key) + ".dat");
                    }
                }
            }

            foreach (string resumeDatFile in files)
            {
                BTResume btp = new BTResume(SetProg, resumeDatFile);

                btp.DoWork(sl, searchFolder, lvUTResults, cbUTUseHashing.Checked, cbUTMatchMissing.Checked, cbUTSetPrio.Checked,
                           testMode, chkUTSearchSubfolders.Checked, mDoc.TheActionList, TVSettings.Instance.FNPRegexs,
                           mDoc.Args);
            }

            if (!testMode)
            {
                RestartUTorrent();
            }
        }
Exemple #3
0
        private void bnUTGo_Click(object sender, EventArgs e)
        {
            if (!CheckResumeDatPath())
            {
                return;
            }

            if (Directory.Exists(Path.Combine(Path.GetDirectoryName(TVSettings.Instance.ResumeDatPath), "resume_dir")))
            {
                UpdateResumeDats();
                return;
            }

            string searchFolder  = txtUTSearchFolder.Text;
            string resumeDatFile = TVSettings.Instance.ResumeDatPath;
            bool   testMode      = chkUTTest.Checked;

            if (!File.Exists(resumeDatFile))
            {
                return;
            }

            if (!testMode && !CheckUTorrentClosed())
            {
                return;
            }

            lvUTResults.Items.Clear();

            BTResume btp = new BTResume(SetProg, resumeDatFile);

            List <string> sl = new List <string>();

            foreach (string torrent in lbUTTorrents.CheckedItems)
            {
                sl.Add(Path.Combine(Path.GetDirectoryName(resumeDatFile), torrent));
            }

            btp.DoWork(sl, searchFolder, lvUTResults, cbUTUseHashing.Checked, cbUTMatchMissing.Checked, cbUTSetPrio.Checked,
                       testMode, chkUTSearchSubfolders.Checked, mDoc.TheActionList, TVSettings.Instance.FNPRegexs,
                       mDoc.Args);

            if (!testMode)
            {
                RestartUTorrent();
            }
        }
Exemple #4
0
        private void bnUTGo_Click(object sender, System.EventArgs e)
        {
            if (!this.CheckResumeDatPath())
                return;

            string searchFolder = this.txtUTSearchFolder.Text;
            string resumeDatFile = this.mDoc.Settings.ResumeDatPath;
            bool testMode = this.chkUTTest.Checked;

            if (!File.Exists(resumeDatFile))
                return;

            if (!testMode && !CheckUTorrentClosed())
                return;
            //
            //				 int action = actNone;
            //				 if (chkUTSearchSubfolders->Checked)
            //					 action |=  actSearchSubfolders;
            //
            //
            //
            //				 if ( (action & (actRename | actCopy | actMatchMissing | actHashSearch)) == 0 )
            //					 return;
            //

            this.lvUTResults.Items.Clear();

            BTResume btp = new BTResume(this.SetProg, resumeDatFile);

            List<string> sl = new List<String>();

            foreach (string torrent in this.lbUTTorrents.CheckedItems)
                sl.Add(torrent);

            btp.DoWork(sl, searchFolder, this.lvUTResults, this.cbUTUseHashing.Checked, this.cbUTMatchMissing.Checked, this.cbUTSetPrio.Checked,
                       testMode, this.chkUTSearchSubfolders.Checked, this.mDoc.TheActionList, this.mDoc.Settings.FNPRegexs,
                       mDoc.Args);

            if (!testMode)
                RestartUTorrent();
        }