Exemplo n.º 1
0
        private void backgroundWorker1_DoWork(object sender, DoWorkEventArgs e)
        {
            backgroundWorker1.WorkerSupportsCancellation = true;
            var    destination    = e.Argument.ToString();
            string checkFinalPath = @Properties.Settings.Default.FinalPath + @"\" + Settings.Default.CurrentTitle;
            bool   DontRip        = Ripping.CheckForRecentRip(checkFinalPath);

            if (Settings.Default.LastRipTitle == Settings.Default.CurrentTitle)
            {
                DontRip = false;
            }
            if (!DontRip)
            {
                Ripping.MakeWorkingDirs();
                string makeMKVPath = Settings.Default.MakeMKVPath;

                if (System.IO.File.Exists(makeMKVPath))
                {
                    string ripPath = @destination + @"\" + CurrentTitle;
                    Ripping.UpdateStatusText("Ripping to: " + ripPath);
                    char[] charsToTrim    = { '\\' };
                    string activeDisc     = Settings.Default.DVDDrive.TrimEnd(charsToTrim);
                    string minTitleLength = Settings.Default.MinTitleLength;
                    var    driveID        = Ripping.DVDDriveToUse;

                    string MakeMKVOptions = " --robot --messages=" + @ripPath + "riplog.txt --decrypt --noscan --minlength=" + minTitleLength + " --directio=true mkv disc:0 all " + @ripPath;

                    string app = makeMKVPath;

                    Ripping.LaunchCommandLineApp(@app, @MakeMKVOptions);
                }
                else
                {
                    // Initializes the variables to pass to the MessageBox.Show method.
                    string            message = "MakeMKV not found";
                    string            caption = "Error Detected in Input";
                    MessageBoxButtons buttons = MessageBoxButtons.OK;
                    DialogResult      result;

                    // Displays the MessageBox.
                    result = MessageBox.Show(message, caption, buttons);

                    if (result == System.Windows.Forms.DialogResult.OK)
                    {
                    }
                }
            }
            else
            {
                if (Settings.Default.RipRetry >= 2)
                {
                    return;
                }
            }
            Ripping.SaveSettings();
            return;
        }
Exemplo n.º 2
0
        private void backgroundWorker_DoWork(object sender, DoWorkEventArgs e)
        {
            backgroundWorker.WorkerSupportsCancellation = true;

            while (textBoxCurrentTitle.Text == "" || textBoxCurrentTitle.Text == null)
            {
                Thread.Sleep(500);
                Ripping.refreshdata();
            }
            StartTheTimer();
        }
Exemplo n.º 3
0
        public Preferences()
        {
            InitializeComponent();
            this.WindowState = FormWindowState.Normal;

            Ripping.CheckHandBrakeInstall();
            Ripping.CheckMakeMKVInstall();

            //AutoRip2MKV.Convert.AddTitleToConvvertList();
            //AutoRip2MKV.Convert.ConvertWithHandbrake();


            StartTheTimer();
        }
Exemplo n.º 4
0
        private void button2_Click_1(object sender, EventArgs e)
        {
            OpenOrCloseCDDrive.Close();
            Thread.Sleep(5000);
            var DVDDriveToUse = Ripping.GetDriveInfo("drive");
            var CurrentTitle  = Ripping.GetDriveInfo("label");

            Settings.Default.CurrentTitle = CurrentTitle;
            Settings.Default.DVDDrive     = DVDDriveToUse;
            textBoxCurrentTitle.Text      = CurrentTitle;
            dvdDriveID.Text = DVDDriveToUse;
            Ripping.SaveSettings();
            this.Refresh();
            StartTheTimer();
        }
Exemplo n.º 5
0
        private void Save_Click(object sender, EventArgs e)
        {
            // Copy window location to app settings
            Settings.Default.WindowLocation = this.Location;
            Settings.Default.WindowSize     = this.Size;

            // Copy window size to app settings
            if (this.WindowState == FormWindowState.Normal)
            {
                Settings.Default.WindowSize = this.Size;
            }
            else
            {
                Settings.Default.WindowSize = this.RestoreBounds.Size;
            }
            Ripping.SaveSettings();
        }
Exemplo n.º 6
0
        public static void Main(bool results)
        {
            SmtpClient        smtpClient      = new SmtpClient();
            NetworkCredential basicCredential = new NetworkCredential(smtpuser, smtppass);
            MailMessage       message         = new MailMessage();
            MailAddress       fromAddress     = new MailAddress(userfromemail, "AutoRip2MKV");

            smtpClient.Host = Properties.Settings.Default.SMTPAddress;
            //"email-smtp.us-east-1.amazonaws.com";
            smtpClient.Port = Properties.Settings.Default.SMTPPort;
            smtpClient.UseDefaultCredentials = false;
            smtpClient.DeliveryMethod        = SmtpDeliveryMethod.Network;
            smtpClient.EnableSsl             = Properties.Settings.Default.EnableTTL;
            smtpClient.Credentials           = basicCredential;

            message.From    = fromAddress;
            message.Subject = "AutoRip2MKV Status";
            //Set IsBodyHtml to true means you can send HTML email.
            //message.IsBodyHtml = true;
            if (results)
            {
                message.Body = "Rip of " + Properties.Settings.Default.CurrentTitle + " was successful";
            }
            else
            {
                message.Body = "Rip of " + Properties.Settings.Default.CurrentTitle +
                               " failed. \r\n  Verify you have the latest version of MakeMKV installed.";
            }

            message.To.Add(usertxtto);

            try
            {
                smtpClient.Send(message);
            }
            catch (Exception ex)
            {
                //Error, could not send the message
                Ripping.UpdateStatusText(ex.Message);
            }
        }
Exemplo n.º 7
0
        private void ExecuteRipProcess()
        {
            Ripping.SaveSettings();
            this.WindowState = FormWindowState.Minimized;
            List <object> arguments = new List <object>();

            if (textBoxCurrentTitle.Text != "")
            {
                if (Settings.Default.TempPath != "")
                {
                    arguments.Add(Settings.Default.TempPath + @"\" + Settings.Default.CurrentTitle);
                }
                else
                {
                    arguments.Add(Settings.Default.FinalPath + @"\" + Settings.Default.CurrentTitle);
                }
            }
            if (!backgroundWorker1.IsBusy)
            {
                backgroundWorker1.RunWorkerAsync(arguments[0].ToString());
            }
        }
Exemplo n.º 8
0
 private void button2_Click(object sender, EventArgs e)
 {
     Ripping.SaveSettings();
 }
Exemplo n.º 9
0
 private void button1_Click_1(object sender, EventArgs e)
 {
     Ripping.SaveSettings();
     SMTPSender.Main(true);
     this.Refresh();
 }