Skip to content
This repository was archived by the owner on Jan 19, 2022. It is now read-only.

Commit 5d44258

Browse files
committed
Checks for existing file
1 parent 173eac4 commit 5d44258

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

WPFMETRO/Queue.cs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,13 @@
55
using System.Collections.ObjectModel;
66
using System.Collections.Specialized;
77
using System.Diagnostics;
8+
using System.IO;
89
using System.Linq;
910
using System.Net;
1011
using System.Text;
1112
using System.Text.RegularExpressions;
1213
using System.Threading.Tasks;
14+
using System.Windows;
1315

1416
namespace WPFMETRO
1517
{
@@ -32,8 +34,9 @@ class Queue
3234

3335
UseShellExecute = false,
3436
RedirectStandardOutput = true,
37+
RedirectStandardError = true,
3538
CreateNoWindow = true,
36-
StandardOutputEncoding = Encoding.UTF8,
39+
StandardOutputEncoding = Encoding.GetEncoding(850),
3740
FileName = "youtube-dl.exe"
3841
};
3942

@@ -223,6 +226,10 @@ public void DownloadChannel(string ID, string filename, string path, string file
223226

224227
public void ModifyQueue(string title, string thumbURL, string ID, string filename, string path, string filetype, Dictionary<string, string> formats)
225228
{
229+
if(File.Exists(path+filename+"."+formats[filetype]) || (filename == "%(title)s.%(ext)s" && File.Exists(path + title + "." + formats[filetype])))
230+
{
231+
MessageBox.Show("File exists");
232+
}
226233
if (ID.Contains("youtu.be/") || ID.Contains("youtube.com/"))
227234
{
228235
if (ID.Contains("playlist"))

0 commit comments

Comments
 (0)