Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
added a checkbox to disable the video selection aspect
  • Loading branch information
murrty authored Dec 31, 2020
1 parent 8d2ec50 commit 80ce43d
Show file tree
Hide file tree
Showing 3 changed files with 234 additions and 214 deletions.
17 changes: 9 additions & 8 deletions Forms/frmDownloader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -97,10 +97,10 @@ private void btnDownloaderAbortBatchDownload_Click(object sender, EventArgs e) {
private void btnDownloaderCancelExit_Click(object sender, EventArgs e) {
if (!DownloadFinished && !DownloadErrored && !DownloadAborted) {
DownloadAborted = true;
if (!DownloadProcess.HasExited) {
if (DownloadProcess != null && !DownloadProcess.HasExited) {
DownloadProcess.Kill();
}
if (DownloadThread.IsAlive) {
if (DownloadThread != null && DownloadThread.IsAlive) {
DownloadThread.Abort();
}
System.Media.SystemSounds.Hand.Play();
Expand Down Expand Up @@ -137,15 +137,16 @@ private void BeginDownload() {
YoutubeDlFileName = verif.YoutubeDlPath;
}
if (YoutubeDlFileName == null) {
rtbConsoleOutput.AppendText("Youtube-DL has not been found\nA rescan for youtube-dl was called");
rtbConsoleOutput.AppendText("Youtube-DL has not been found\nA rescan for youtube-dl was called\n");
verif.RefreshYoutubeDlLocation();
if (verif.YoutubeDlPath != null) {
rtbConsoleOutput.AppendText("try redownloading the video, it seems to be detected now.");
rtbConsoleOutput.AppendText("Rescan finished and found, continuing\n");
}
else {
rtbConsoleOutput.AppendText("still couldnt find youtube-dl.");
DownloadErrored = true;
return;
}
return;
}
rtbConsoleOutput.AppendText("Youtube-DL has been found and set\n");
#endregion
Expand Down Expand Up @@ -263,7 +264,7 @@ private void BeginDownload() {
}
break;
case 1: // playlist-items
ArgumentsBuffer += " --platlist-items " + SelectionArg;
ArgumentsBuffer += " --playlist-items " + SelectionArg;
break;
case 2: // datebefore
ArgumentsBuffer += " --datebefore " + SelectionArg;
Expand Down Expand Up @@ -575,8 +576,8 @@ private void CloseForm() {
}
if (!DownloadFinished) {
try {
if (!DownloadProcess.HasExited) { DownloadProcess.Kill(); }
if (DownloadThread.IsAlive) { DownloadThread.Abort(); }
if (DownloadProcess != null && !DownloadProcess.HasExited) { DownloadProcess.Kill(); }
if (DownloadThread != null && DownloadThread.IsAlive) { DownloadThread.Abort(); }
}
catch (Exception ex) {
ErrorLog.ReportException(ex);
Expand Down
Loading

0 comments on commit 80ce43d

Please sign in to comment.