Skip to content

Commit d6bb5f6

Browse files
committed
Minor Release [v4.3.0.0]
- Improved the progress bar for the queue system - Added a config option to allow only specified urls to be downloaded from - Double-clicking the url textbox now navigates to the current url in a browser - Fixed minor bugs - MediaDownloader Updater v1.1.0 - Made it run inside a shell window instead of a powershell windows - Made it work as a standalone updater
1 parent d06f616 commit d6bb5f6

15 files changed

Lines changed: 267 additions & 97 deletions

File tree

1.39 KB
Loading

changelog.txt

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
1-
~
1+
~ v4.3.0.0
2+
- Improved the progress bar for the queue system
3+
- Added a config option to allow only specified urls to be downloaded from
24
- Double-clicking the url textbox now navigates to the current url in a browser
3-
- Improved the updater
5+
- Fixed minor bugs
6+
- MediaDownloader Updater v1.1.0
7+
- Made it run inside a shell window instead of a powershell windows
8+
- Made it work as a standalone updater
49

510
~ v4.2.3.0
611
- Fixed playlist downloader not working with named folders (I broke it for the 2nd time, I swear it's fixed now :) )

src/MediaDownloader/MediaDownloader/Init.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,9 @@ static void Main()
6262
CONFIG = ReadConfig("MediaDownloader\\config\\config.cfg");
6363
else
6464
{
65-
CONFIG.DATA_PACKING_ENABLE = true;
6665
CONFIG.NOTIFICATIONS_ENABLE = true;
66+
CONFIG.DATA_PACKING_ENABLE = true;
67+
CONFIG.TRUSTED_URLS = "youtube.com,youtu.be,twitter.com,instagram.com";
6768
}
6869

6970
if (File.Exists("MediaDownloader\\config\\queue.pack") || Directory.Exists("MediaDownloader\\config\\queue"))

src/MediaDownloader/MediaDownloader/MainMenu.Designer.cs

Lines changed: 112 additions & 54 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/MediaDownloader/MediaDownloader/MainMenu.cs

Lines changed: 54 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -78,17 +78,19 @@ private void Program_Load(object sender, EventArgs e)
7878

7979
// update check
8080
var newVersionAvailable = CheckForNewUpdate(VERSION_INTERNAL);
81-
if (newVersionAvailable.Item1 && CONFIG.NOTIFICATIONS_ENABLE)
81+
if (newVersionAvailable.Item1 && CONFIG.NOTIFICATIONS_ENABLE && !VERSION_INTERNAL.Contains("dev"))
8282
{
8383
VERSION_REMOTE = newVersionAvailable.Item2;
8484
NotificationPictureBox.Visible = true;
85+
NotificationLabel.Visible = true;
8586
}
8687

8788
#region loadTooltips
8889
// bind tooltips
8990
string[] tooltipMap = {
9091
"BannerPicture", "MediaDownloader by o7q",
9192
"NotificationPictureBox", "Update available",
93+
"NotificationLabel", "Update available",
9294
"VersionLabel", "Version " + VERSION,
9395

9496
"MinimizeButton", "Minimize",
@@ -141,7 +143,6 @@ private void Program_Load(object sender, EventArgs e)
141143
"QueueAddButton", "Add an item to the queue",
142144
"QueueRemoveButton", "Remove the selected item from the queue",
143145
"DownloadAllButton", "Download all items in the queue",
144-
"QueueProgressBar", "Queue progress bar",
145146

146147
"HistoryListBox", "List of previous downloads",
147148
"HistoryLoadButton", "Load the config from the selected item",
@@ -180,18 +181,34 @@ private void DownloadButton_Click(object sender, EventArgs e)
180181
return;
181182
}
182183

183-
if (IS_DOWNLOADING || currentQueueItem.URL == "" || currentQueueItem.URL == null)
184+
bool containsTrustedUrl = CONFIG.TRUSTED_URLS_ENABLE ? false : true;
185+
if (currentQueueItem.URL != null && CONFIG.TRUSTED_URLS_ENABLE)
186+
{
187+
string[] trustedUrls = CONFIG.TRUSTED_URLS.Split(',');
188+
for (int i = 0; i < trustedUrls.Length; i++)
189+
{
190+
if (currentQueueItem.URL.IndexOf(trustedUrls[i], StringComparison.OrdinalIgnoreCase) >= 0)
191+
containsTrustedUrl = true;
192+
}
193+
}
194+
195+
if (IS_DOWNLOADING || currentQueueItem.URL == "" || currentQueueItem.URL == null || !containsTrustedUrl)
184196
return;
185197

186198
Task.Run(() => StartDownload(currentQueueItem, OutputNameTextBox, DownloadButton, DownloadAllButton));
187199
}
188200

189201
private void DownloadAllButton_Click(object sender, EventArgs e)
190202
{
191-
if (IS_DOWNLOADING)
203+
if (ModifierKeys == Keys.Control || ModifierKeys == Keys.Shift)
204+
{
205+
IS_DOWNLOADING = false;
206+
ChangeDownloadButtonColors(false, DownloadButton, DownloadAllButton);
192207
return;
208+
}
193209

194-
QueueProgressBar.Value = 0;
210+
if (IS_DOWNLOADING || QueueListBox.Items.Count == 0)
211+
return;
195212

196213
string[] queueList = new string[QueueListBox.Items.Count];
197214
int queueIndex = 0;
@@ -201,7 +218,7 @@ private void DownloadAllButton_Click(object sender, EventArgs e)
201218
queueIndex++;
202219
}
203220

204-
Task.Run(() => StartDownloadQueue(queueList, DownloadButton, DownloadAllButton, QueueProgressBar));
221+
Task.Run(() => StartDownloadQueue(queueList, DownloadButton, DownloadAllButton, QueueProgressBarPanel, QueueProgressLabel));
205222
}
206223

207224
private void QueueAddButton_Click(object sender, EventArgs e)
@@ -855,16 +872,23 @@ private void ExpandMenu()
855872
MenuExpandButton.Size = new Size(29, 102);
856873
MenuExpandButton.Text = "<<";
857874

875+
QueueLabel.Visible = true;
876+
QueueDecorationPanel.Visible = true;
877+
858878
QueueListBox.Visible = true;
859-
QueueProgressBar.Visible = true;
860879

861880
DownloadAllButton.Visible = true;
862881

882+
QueueProgressLabel.Visible = true;
883+
QueueProgressBarPanel.Visible = true;
884+
QueueProgressPanel.Visible = true;
885+
QueueProgressDecorationPanel.Visible = true;
886+
863887
QueueAddButton.Visible = true;
864888
QueueRemoveButton.Visible = true;
865889

866-
QueueLabel.Visible = true;
867-
QueueDecorationPanel.Visible = true;
890+
HistoryLabel.Visible = true;
891+
HistoryDecorationPanel.Visible = true;
868892

869893
HistoryListBox.Visible = true;
870894

@@ -876,9 +900,6 @@ private void ExpandMenu()
876900
HistoryRefreshButton.Visible = true;
877901
HistoryRemoveButton.Visible = true;
878902

879-
HistoryLabel.Visible = true;
880-
HistoryDecorationPanel.Visible = true;
881-
882903
Size = new Size(691, 244);
883904

884905
TitlebarPanel.Size = new Size(691, 35);
@@ -897,16 +918,23 @@ private void CollapseMenu()
897918
MenuExpandButton.Size = new Size(29, 207);
898919
MenuExpandButton.Text = ">>";
899920

900-
QueueListBox.Visible = false;
901-
QueueProgressBar.Visible = false;
921+
QueueLabel.Visible = false;
922+
QueueDecorationPanel.Visible = false;
923+
924+
QueueListBox.Visible = true;
902925

903926
DownloadAllButton.Visible = false;
904927

928+
QueueProgressLabel.Visible = false;
929+
QueueProgressBarPanel.Visible = false;
930+
QueueProgressPanel.Visible = false;
931+
QueueProgressDecorationPanel.Visible = false;
932+
905933
QueueAddButton.Visible = false;
906934
QueueRemoveButton.Visible = false;
907935

908-
QueueLabel.Visible = false;
909-
QueueDecorationPanel.Visible = false;
936+
HistoryLabel.Visible = false;
937+
HistoryDecorationPanel.Visible = false;
910938

911939
HistoryListBox.Visible = false;
912940

@@ -918,9 +946,6 @@ private void CollapseMenu()
918946
HistoryRefreshButton.Visible = false;
919947
HistoryRemoveButton.Visible = false;
920948

921-
HistoryLabel.Visible = false;
922-
HistoryDecorationPanel.Visible = false;
923-
924949
Size = new Size(408, 244);
925950

926951
TitlebarPanel.Size = new Size(408, 35);
@@ -1014,6 +1039,16 @@ private void VersionLabel_MouseDown(object sender, MouseEventArgs e)
10141039
}
10151040

10161041
private void NotificationPictureBox_Click(object sender, EventArgs e)
1042+
{
1043+
RunUpdateDialog();
1044+
}
1045+
1046+
private void NotificationLabel_Click(object sender, EventArgs e)
1047+
{
1048+
RunUpdateDialog();
1049+
}
1050+
1051+
private void RunUpdateDialog()
10171052
{
10181053
string changelog = ReadRemoteResource("https://raw.githubusercontent.com/o7q/MediaDownloader/main/remote/changelog");
10191054

src/MediaDownloader/MediaDownloader/MediaDownloader.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,7 @@
123123
</ItemGroup>
124124
<ItemGroup>
125125
<Content Include="logo.ico" />
126+
<None Include="Resources\settings.png" />
126127
<None Include="Resources\notification.png" />
127128
<None Include="Resources\background.png" />
128129
<None Include="Resources\banner_hq.png" />

src/MediaDownloader/MediaDownloader/Properties/Resources.Designer.cs

Lines changed: 10 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/MediaDownloader/MediaDownloader/Properties/Resources.resx

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -121,16 +121,19 @@
121121
<data name="background" type="System.Resources.ResXFileRef, System.Windows.Forms">
122122
<value>..\Resources\background.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
123123
</data>
124-
<data name="banner_hq" type="System.Resources.ResXFileRef, System.Windows.Forms">
125-
<value>..\Resources\banner_hq.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
124+
<data name="x" type="System.Resources.ResXFileRef, System.Windows.Forms">
125+
<value>..\Resources\x.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
126126
</data>
127127
<data name="folder" type="System.Resources.ResXFileRef, System.Windows.Forms">
128128
<value>..\Resources\folder.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
129129
</data>
130-
<data name="x" type="System.Resources.ResXFileRef, System.Windows.Forms">
131-
<value>..\Resources\x.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
132-
</data>
133130
<data name="notification" type="System.Resources.ResXFileRef, System.Windows.Forms">
134131
<value>..\Resources\notification.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
135132
</data>
133+
<data name="banner_hq" type="System.Resources.ResXFileRef, System.Windows.Forms">
134+
<value>..\Resources\banner_hq.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
135+
</data>
136+
<data name="settings" type="System.Resources.ResXFileRef, System.Windows.Forms">
137+
<value>..\Resources\settings.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
138+
</data>
136139
</root>
1.39 KB
Loading

src/MediaDownloader/MediaDownloader/Scripts/Data/Config/ConfigManager.cs

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,16 +33,20 @@ public static ConfigBase ReadConfig(string location)
3333

3434
switch (configSettingPair[0])
3535
{
36+
// user config
37+
case "HISTORY_ENABLE": config.HISTORY_ENABLE = bool.Parse(configSettingPair[1]); break;
38+
case "NOTIFICATIONS_ENABLE": config.NOTIFICATIONS_ENABLE = bool.Parse(configSettingPair[1]); break;
39+
case "DATA_PACKING_ENABLE": config.DATA_PACKING_ENABLE = bool.Parse(configSettingPair[1]); break;
40+
case "TRUSTED_URLS_ENABLE": config.TRUSTED_URLS_ENABLE = bool.Parse(configSettingPair[1]); break;
41+
case "TRUSTED_URLS": config.TRUSTED_URLS = configSettingPair[1]; break;
42+
43+
// program config
3644
case "MENU_EXPANDED_ENABLE": config.MENU_EXPANDED_ENABLE = bool.Parse(configSettingPair[1]); break;
3745

3846
case "QUEUE_SELECTED_INDEX": config.QUEUE_SELECTED_INDEX = int.Parse(configSettingPair[1]); break;
3947

40-
case "HISTORY_ENABLE": config.HISTORY_ENABLE = bool.Parse(configSettingPair[1]); break;
4148
case "HISTORY_SELECTED_INDEX": config.HISTORY_SELECTED_INDEX = int.Parse(configSettingPair[1]); break;
4249
case "HISTORY_SAVE_INDEX": config.HISTORY_SAVE_INDEX = int.Parse(configSettingPair[1]); break;
43-
44-
case "DATA_PACKING_ENABLE": config.DATA_PACKING_ENABLE = bool.Parse(configSettingPair[1]); break;
45-
case "NOTIFICATIONS_ENABLE": config.NOTIFICATIONS_ENABLE = bool.Parse(configSettingPair[1]); break;
4650
}
4751
}
4852

0 commit comments

Comments
 (0)