Skip to content

Commit 4d002c6

Browse files
committed
Fix folders names. bug fix
1 parent a9a3408 commit 4d002c6

37 files changed

+68
-68
lines changed

TubeDl.sln

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ Microsoft Visual Studio Solution File, Format Version 12.00
33
# Visual Studio 14
44
VisualStudioVersion = 14.0.25123.0
55
MinimumVisualStudioVersion = 10.0.40219.1
6-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TubeDl", "Ytd Extractor\TubeDl.csproj", "{7740ADA6-86ED-4D22-BEC8-B5C7E3202AB1}"
6+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TubeDl", "TubeDl\TubeDl.csproj", "{7740ADA6-86ED-4D22-BEC8-B5C7E3202AB1}"
77
EndProject
88
Global
99
GlobalSection(SolutionConfigurationPlatforms) = preSolution
File renamed without changes.
File renamed without changes.

Ytd Extractor/Main.Designer.cs renamed to TubeDl/Main.Designer.cs

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Ytd Extractor/Main.cs renamed to TubeDl/Main.cs

Lines changed: 64 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
using System.Windows.Forms;
1111
using YoutubeExtractor;
1212

13-
namespace Ytd_Extractor
13+
namespace TubeDl
1414
{
1515
public partial class Main : Form
1616
{
@@ -58,97 +58,97 @@ private void btndownload_Click(object sender, EventArgs e)
5858
* Execute the video downloader.
5959
* For GUI applications note, that this method runs synchronously.
6060
*/
61-
//try
62-
//{
63-
btndownload.Enabled = false;
61+
try
62+
{
63+
btndownload.Enabled = false;
6464

6565

66-
var ext = video.Resolution.ToString();
67-
if (ext == "0")
68-
ext = ".mp3";
69-
else
70-
ext = ".Mp4";
71-
bool found = true;
66+
var ext = video.Resolution.ToString();
67+
if (ext == "0")
68+
ext = ".mp3";
69+
else
70+
ext = ".Mp4";
71+
bool found = true;
7272

73-
ListViewItem item = list_Items.FindItemWithText(name + " " + (video.Resolution == 0 ? ext : video.Resolution.ToString()));
73+
ListViewItem item = list_Items.FindItemWithText(name + " " + (video.Resolution == 0 ? ext.Replace(".", "") : video.Resolution.ToString()));
7474

75-
if (item != null)
76-
MessageBox.Show("Video Already in downloading", Text, MessageBoxButtons.OK, MessageBoxIcon.Information, MessageBoxDefaultButton.Button1);
77-
// video exists
75+
if (item != null)
76+
MessageBox.Show("Video Already in downloading", Text, MessageBoxButtons.OK, MessageBoxIcon.Information, MessageBoxDefaultButton.Button1);
77+
// video exists
7878

79-
else
80-
{
79+
else
80+
{
8181

82-
// doesn't exist
82+
// doesn't exist
8383

8484

85-
if (File.Exists(Path.Combine(savePath, name + " " + (video.Resolution == 0 ? ext : video.Resolution.ToString()) + ext)))
86-
{
87-
if (MessageBox.Show("File Already exist, Replace?", Text,
88-
MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
85+
if (File.Exists(Path.Combine(savePath, name + " " + (video.Resolution == 0 ? ext.Replace(".", "") : video.Resolution.ToString()) + ext)))
86+
{
87+
if (MessageBox.Show("File Already exist, Replace?", Text,
88+
MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
89+
{
90+
File.Delete(Path.Combine(savePath, name + " " + (video.Resolution == 0 ? ext.Replace(".", "") : video.Resolution.ToString()) + ext));
91+
92+
int indx = list_Items.Items.Count;
93+
list_Items.Items.Add(name + " " + (video.Resolution == 0 ? ext.Replace(".", "") : video.Resolution.ToString()));
94+
for (int i = 1; i < 6; i++)
95+
{
96+
list_Items.Items[indx].SubItems.Add("");
97+
}
98+
99+
DownloadHelper.downloadFile d =
100+
new DownloadHelper.downloadFile(url, Path.Combine(savePath, name + " " + (video.Resolution == 0 ? ext.Replace(".", "") : video.Resolution.ToString()) + ext));
101+
ldf.Add(d);
102+
103+
Action<int, int, object> act1 = new Action<int, int, object>(delegate (int idx, int sidx, object obj)
104+
{ list_Items.Invoke(new Action(() => list_Items.Items[idx].SubItems[sidx].Text = obj.ToString())); });
105+
106+
d.eSize += (object s1, string size) => act1.Invoke(indx, 1, size);
107+
d.eDownloadedSize += (object s1, string size) => act1.Invoke(indx, 2, size);
108+
d.eSpeed += (object s1, string size) => act1.Invoke(indx, 3, size);
109+
d.eDownloadState += (object s1, string size) => act1.Invoke(indx, 4, size);
110+
}
111+
else
112+
{
113+
btndownload.Enabled = true;
114+
btnPause.Enabled = false;
115+
}
116+
}
117+
else
89118
{
90-
File.Delete(Path.Combine(savePath, name + " " + (video.Resolution == 0 ? ext : video.Resolution.ToString()) + ext));
91-
92119
int indx = list_Items.Items.Count;
93-
list_Items.Items.Add(name + " " + (video.Resolution == 0 ? ext : video.Resolution.ToString()));
120+
list_Items.Items.Add(name + " " + (video.Resolution == 0 ? ext.Replace(".", "") : video.Resolution.ToString()));
94121
for (int i = 1; i < 6; i++)
95122
{
96123
list_Items.Items[indx].SubItems.Add("");
97124
}
98125

99-
DownloadHelper.downloadFile d =
100-
new DownloadHelper.downloadFile(url, Path.Combine(savePath, name + " " + (video.Resolution == 0 ? ext : video.Resolution.ToString()) + ext));
126+
DownloadHelper.downloadFile d = new DownloadHelper.downloadFile(url, Path.Combine(savePath, name + " " + (video.Resolution == 0 ? ext.Replace(".", "") : video.Resolution.ToString()) + ext));
101127
ldf.Add(d);
102128

103129
Action<int, int, object> act1 = new Action<int, int, object>(delegate (int idx, int sidx, object obj)
104-
{ list_Items.Invoke(new Action(() => list_Items.Items[idx].SubItems[sidx].Text = obj.ToString())); });
130+
{
131+
list_Items.Invoke(new Action(() => list_Items.Items[idx].SubItems[sidx].Text = obj.ToString()));
132+
});
105133

106134
d.eSize += (object s1, string size) => act1.Invoke(indx, 1, size);
107135
d.eDownloadedSize += (object s1, string size) => act1.Invoke(indx, 2, size);
108136
d.eSpeed += (object s1, string size) => act1.Invoke(indx, 3, size);
109137
d.eDownloadState += (object s1, string size) => act1.Invoke(indx, 4, size);
110138
}
111-
else
112-
{
113-
btndownload.Enabled = true;
114-
btnPause.Enabled = false;
115-
}
116-
}
117-
else
118-
{
119-
int indx = list_Items.Items.Count;
120-
list_Items.Items.Add(name + " "+ (video.Resolution == 0 ? ext : video.Resolution.ToString()));
121-
for (int i = 1; i < 6; i++)
122-
{
123-
list_Items.Items[indx].SubItems.Add("");
124-
}
125-
126-
DownloadHelper.downloadFile d = new DownloadHelper.downloadFile(url, Path.Combine(savePath, name + " " + (video.Resolution == 0 ? ext : video.Resolution.ToString()) + ext));
127-
ldf.Add(d);
128-
129-
Action<int, int, object> act1 = new Action<int, int, object>(delegate (int idx, int sidx, object obj)
130-
{
131-
list_Items.Invoke(new Action(() => list_Items.Items[idx].SubItems[sidx].Text = obj.ToString()));
132-
});
133-
134-
d.eSize += (object s1, string size) => act1.Invoke(indx, 1, size);
135-
d.eDownloadedSize += (object s1, string size) => act1.Invoke(indx, 2, size);
136-
d.eSpeed += (object s1, string size) => act1.Invoke(indx, 3, size);
137-
d.eDownloadState += (object s1, string size) => act1.Invoke(indx, 4, size);
138139
}
139140
}
140-
//}
141-
//catch (Exception ex)
142-
//{
143-
// MessageBox.Show(ex.Message);
144-
// btndownload.Enabled = true;
145-
// btnPause.Enabled = false;
141+
catch (Exception ex)
142+
{
143+
MessageBox.Show(ex.Message);
144+
btndownload.Enabled = true;
145+
btnPause.Enabled = false;
146146

147-
//}
147+
}
148148

149149
}
150150

151-
151+
/*
152152
public void DownloadFile(string urlAddress, string location)
153153
{
154154
using (webClient = new WebClient())
@@ -213,7 +213,7 @@ private void Completed(object sender, AsyncCompletedEventArgs e)
213213
File.Move(Path.Combine(savePath, name + ".tubedl"), Path.Combine(savePath, name + video.VideoExtension));
214214
}
215215
}
216-
216+
*/
217217
private void Main_Load(object sender, EventArgs e)
218218
{
219219
#if DEBUG
@@ -331,7 +331,7 @@ private void button1_Click(object sender, EventArgs e)
331331
RemoveIllegalPathCharacters(video.Title);
332332
btndownload.Enabled = true;
333333
#if DEBUG
334-
MessageBox.Show(url + "\n" + savePath + "\n" + name);
334+
// MessageBox.Show(url + "\n" + savePath + "\n" + name);
335335

336336
#endif
337337
}
File renamed without changes.

Ytd Extractor/Program.cs renamed to TubeDl/Program.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
using System;
22
using System.Windows.Forms;
33

4-
namespace Ytd_Extractor
4+
namespace TubeDl
55
{
66
static class Program
77
{

Ytd Extractor/Properties/AssemblyInfo.cs renamed to TubeDl/Properties/AssemblyInfo.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,4 +32,4 @@
3232
// by using the '*' as shown below:
3333
// [assembly: AssemblyVersion("1.0.*")]
3434
[assembly: AssemblyVersion("0.1.0.0")]
35-
[assembly: AssemblyFileVersion("0.1.0.0-beta")]
35+
[assembly: AssemblyFileVersion("0.1.0.1")]
File renamed without changes.

0 commit comments

Comments
 (0)