Skip to content

Commit

Permalink
Merge pull request #4 from dardizzola/svil-010107
Browse files Browse the repository at this point in the history
Pre release 1.9.25
  • Loading branch information
dardizzola authored Jul 1, 2024
2 parents dd320c8 + 652b730 commit 247b7cc
Show file tree
Hide file tree
Showing 81 changed files with 1,820 additions and 1,789 deletions.
Binary file added ApplicationSampleScreens.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,12 @@ Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.4.33403.182
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LaMuccaRossaVideoDownloader", "YoutubePlaylistDownloader\LaMuccaRossaVideoDownloader.csproj", "{57ADF475-AC13-4912-A26B-100C6535A74D}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LaMuccaRossaVideoDownloader", "LaMuccaRossaVideoDownloader\LaMuccaRossaVideoDownloader.csproj", "{57ADF475-AC13-4912-A26B-100C6535A74D}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{2A76AF85-987A-41AE-8D9B-5A510CFB2455}"
ProjectSection(SolutionItems) = preProject
ApplicationSampleScreens.gif = ApplicationSampleScreens.gif
FFmpeg\ffmpeg.exe = FFmpeg\ffmpeg.exe
License.txt = License.txt
README.md = README.md
YPDSetup\YPDSetup.iss = YPDSetup\YPDSetup.iss
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
</Paragraph>
<Paragraph TextAlignment="Left" FlowDirection="LeftToRight">
<Run FontSize="14" Text="{DynamicResource CreditsAndContributors}" />

</Paragraph>
<Paragraph TextAlignment="Center">
<Image x:Name="AboutLogoLMR" Height="150" Width="270" Source="/Logo La Mucca Rossa 1096x591.png"/>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,69 +1,69 @@
namespace LaMuccaRossaVideoDownloader;

/// <summary>
/// Interaction logic for About.xaml
/// </summary>
public partial class About : UserControl
{
public About()
{
InitializeComponent();
GlobalConsts.HideAboutButton();
GlobalConsts.ShowHomeButton();
GlobalConsts.ShowSettingsButton();
GlobalConsts.ShowHelpButton();

AboutRun.Text += GlobalConsts.VERSION;
}

private async void UpdateButton_Click(object sender, RoutedEventArgs e)
{
try
{
using var client = new HttpClient();
client.DefaultRequestHeaders.CacheControl = new CacheControlHeaderValue() { NoCache = true };

string gitHubUrl = String.Format("https://raw.githubusercontent.com/{0}/{1}/{2}/{3}/",
GlobalConsts.APPLICATION_GITHUB_USERNAME,
GlobalConsts.APPLICATION_REPOSITORY_NAME,
GlobalConsts.APPLICATION_REPOSITORY_BRANCH,
GlobalConsts.APPLICATION_REPOSITORY_FOLDER
);

var response = await client.GetStringAsync(gitHubUrl + "latestVersionWithRevision.txt");
var latestVersion = Version.Parse(response);

if (latestVersion > GlobalConsts.VERSION)
{
var changelog = await client.GetStringAsync(gitHubUrl + "changelog.txt");
var dialogSettings = new MetroDialogSettings()
{
AffirmativeButtonText = $"{FindResource("UpdateNow")}",
NegativeButtonText = $"{FindResource("No")}",
FirstAuxiliaryButtonText = $"{FindResource("UpdateWhenIExit")}",
ColorScheme = MetroDialogColorScheme.Theme,
DefaultButtonFocus = MessageDialogResult.Affirmative,
};
var update = await GlobalConsts.Current.ShowMessageAsync($"{FindResource("NewVersionAvailable")}", $"{FindResource("DoYouWantToUpdate")}\n{changelog}",
MessageDialogStyle.AffirmativeAndNegativeAndSingleAuxiliary, dialogSettings);
if (update == MessageDialogResult.Affirmative)
{
GlobalConsts.LoadPage(new DownloadUpdate(latestVersion, changelog));
}
else if (update == MessageDialogResult.FirstAuxiliary)
{
GlobalConsts.UpdateControl = new DownloadUpdate(latestVersion, changelog, true).UpdateLaterStillDownloading();
}
}
else
{
await GlobalConsts.ShowMessage($"{FindResource("NoUpdates")}", $"{FindResource("NoUpdatesAvailable")}");
}
}
catch (Exception ex)
{
await GlobalConsts.Log(ex.ToString(), "About UpdateButton_Click");
await GlobalConsts.ShowMessage($"{FindResource("Error")}", $"{FindResource("CannotUpdate")} {ex.Message}");
}
}
}
namespace LaMuccaRossaVideoDownloader;

/// <summary>
/// Interaction logic for About.xaml
/// </summary>
public partial class About : UserControl
{
public About()
{
InitializeComponent();
GlobalConsts.HideAboutButton();
GlobalConsts.ShowHomeButton();
GlobalConsts.ShowSettingsButton();
GlobalConsts.ShowHelpButton();

AboutRun.Text += GlobalConsts.VERSION;
}

private async void UpdateButton_Click(object sender, RoutedEventArgs e)
{
try
{
using var client = new HttpClient();
client.DefaultRequestHeaders.CacheControl = new CacheControlHeaderValue() { NoCache = true };

string gitHubUrl = String.Format("https://raw.githubusercontent.com/{0}/{1}/{2}/{3}/",
GlobalConsts.APPLICATION_GITHUB_USERNAME,
GlobalConsts.APPLICATION_REPOSITORY_NAME,
GlobalConsts.APPLICATION_REPOSITORY_BRANCH,
GlobalConsts.APPLICATION_REPOSITORY_FOLDER
);

var response = await client.GetStringAsync(gitHubUrl + "latestVersionWithRevision.txt");
var latestVersion = Version.Parse(response);

if (latestVersion > GlobalConsts.VERSION)
{
var changelog = await client.GetStringAsync(gitHubUrl + "changelog.txt");
var dialogSettings = new MetroDialogSettings()
{
AffirmativeButtonText = $"{FindResource("UpdateNow")}",
NegativeButtonText = $"{FindResource("No")}",
FirstAuxiliaryButtonText = $"{FindResource("UpdateWhenIExit")}",
ColorScheme = MetroDialogColorScheme.Theme,
DefaultButtonFocus = MessageDialogResult.Affirmative,
};
var update = await GlobalConsts.Current.ShowMessageAsync($"{FindResource("NewVersionAvailable")}", $"{FindResource("DoYouWantToUpdate")}\n{changelog}",
MessageDialogStyle.AffirmativeAndNegativeAndSingleAuxiliary, dialogSettings);
if (update == MessageDialogResult.Affirmative)
{
GlobalConsts.LoadPage(new DownloadUpdate(latestVersion, changelog));
}
else if (update == MessageDialogResult.FirstAuxiliary)
{
GlobalConsts.UpdateControl = new DownloadUpdate(latestVersion, changelog, true).UpdateLaterStillDownloading();
}
}
else
{
await GlobalConsts.ShowMessage($"{FindResource("NoUpdates")}", $"{FindResource("NoUpdatesAvailable")}");
}
}
catch (Exception ex)
{
await GlobalConsts.Log(ex.ToString(), "About UpdateButton_Click");
await GlobalConsts.ShowMessage($"{FindResource("Error")}", $"{FindResource("CannotUpdate")} {ex.Message}");
}
}
}
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Themes/Light.Blue.xaml" />
<ResourceDictionary Source="/Resources/Styles.xaml"/>
<ResourceDictionary Source="/Languages/LanguagesList.xaml"/>
<ResourceDictionary Source="/Languages/English.xaml" />
<ResourceDictionary Source="/Languages/Italiano.xaml" />
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</Application.Resources>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,45 +1,45 @@
namespace LaMuccaRossaVideoDownloader;

/// <summary>
/// Interaction logic for App.xaml
/// </summary>
public partial class App : Application
{

public App()
{
DispatcherUnhandledException += App_DispatcherUnhandledException;
}

protected override void OnStartup(StartupEventArgs e)
{
base.OnStartup(e);
GlobalConsts.LoadConsts();
GlobalConsts.CreateTempFolder();
}

protected override void OnExit(ExitEventArgs e)
{
GlobalConsts.SaveConsts();
if (GlobalConsts.UpdateOnExit && !string.IsNullOrWhiteSpace(GlobalConsts.UpdateSetupLocation) && GlobalConsts.UpdateFinishedDownloading)
{
Process.Start(GlobalConsts.UpdateSetupLocation);
}
else
{
GlobalConsts.CleanTempFolder();
}
base.OnExit(e);
}

async void App_DispatcherUnhandledException(object sender, DispatcherUnhandledExceptionEventArgs e)
{
await GlobalConsts.ShowMessage((string)FindResource("Error"), (string)FindResource("ErrorMessage"));
await GlobalConsts.Log($"{e.Exception}", "Unhandled exception");

// Don't crash at the moment of truth >.<
#if !DEBUG
e.Handled = true;
#endif
}
}
namespace LaMuccaRossaVideoDownloader;

/// <summary>
/// Interaction logic for App.xaml
/// </summary>
public partial class App : Application
{

public App()
{
DispatcherUnhandledException += App_DispatcherUnhandledException;
}

protected override void OnStartup(StartupEventArgs e)
{
base.OnStartup(e);
GlobalConsts.LoadConsts();
GlobalConsts.CreateTempFolder();
}

protected override void OnExit(ExitEventArgs e)
{
GlobalConsts.SaveConsts();
if (GlobalConsts.UpdateOnExit && !string.IsNullOrWhiteSpace(GlobalConsts.UpdateSetupLocation) && GlobalConsts.UpdateFinishedDownloading)
{
Process.Start(GlobalConsts.UpdateSetupLocation);
}
else
{
GlobalConsts.CleanTempFolder();
}
base.OnExit(e);
}

async void App_DispatcherUnhandledException(object sender, DispatcherUnhandledExceptionEventArgs e)
{
await GlobalConsts.ShowMessage((string)FindResource("Error"), (string)FindResource("ErrorMessage"));
await GlobalConsts.Log($"{e.Exception}", "Unhandled exception");

// Don't crash at the moment of truth >.<
#if !DEBUG
e.Handled = true;
#endif
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
Version 1.9.24:
Version 1.9.25:
- Pre Release for La Mucca Rossa

Version 1.9.24:
- Fixed videos not downloading

Version 1.9.23:
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,13 @@
<StackPanel Margin="10,0,0,0" >
<StackPanel Orientation="Horizontal">
<Label Content="{DynamicResource SaveDirectory}" Margin="5" />
<TextBox x:Name="SaveDirectoryTextBox" Margin="5" TextChanged="SaveDirectoryTextBox_TextChanged" MouseDoubleClick="TextBox_MouseDoubleClick" HorizontalAlignment="Left" MinWidth="120" />
<Controls:Tile Grid.Row="4" Grid.Column="2" Width="30" Height="30" Click="Tile_Click" HorizontalAlignment="Left" >
<iconPacks:PackIconModern Width="20" Height="20" Kind="FolderOpen" Margin="5" />
<TextBox x:Name="SaveDirectoryTextBox" Margin="5" TextChanged="SaveDirectoryTextBox_TextChanged" MouseDoubleClick="TextBox_MouseDoubleClick" HorizontalAlignment="Left" VerticalAlignment="Center" MinWidth="180" />
<WrapPanel>
<Controls:Tile Grid.Row="4" Grid.Column="2" Width="40" Height="40" Click="Tile_Click" HorizontalAlignment="Left" >
<iconPacks:PackIconModern Width="30" Height="20" Kind="FolderOpen" Margin="9" />
</Controls:Tile>
<Label Content="{DynamicResource BrowseFolders}" VerticalAlignment="Center" />
</WrapPanel>
</StackPanel>
<CheckBox x:Name="UniquePlaylistDirectoryCheckBox" Content="{DynamicResource SavePlaylistInUniqueDirectory}" Margin="5" />
<CheckBox x:Name="OpenDestinationFolderCheckBox" Content="{DynamicResource OpenDestinationFolderOnFinish}" Margin="5" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,9 @@ public DownloadUpdate(Version latestVersion, string changelog, bool updateLater
downloadFinished = false;
GlobalConsts.UpdateSetupLocation = $"{GlobalConsts.TempFolderPath}Setup {latestVersion}.exe";

ImageUrl = $"https://raw.githubusercontent.com/dardizzola/LaMuccaRossaVideoDownloader/master/LaMuccaRossaVideoDownloader/finalIcon.ico";
Title = $"{FindResource("DownloadingUpdateSetup")}";
ImageUrl = $"https://raw.githubusercontent.com/dardizzola/LaMuccaRossaVideoDownloader/main/LaMuccaRossaVideoDownloader/finalIcon.ico";

Title = $"{FindResource("DownloadingUpdateSetup")}";
CurrentStatus = (string)FindResource("Loading");
TotalDownloaded = $"(0/1)";
CurrentProgressPercent = 0;
Expand All @@ -115,7 +116,7 @@ private async Task StartUpdate()
await Dispatcher.InvokeAsync(() => HeadlineTextBlock.Text = $"{FindResource("DownloadingUpdateSetup")}");
using var fs = new ProgressStream(new FileStream(GlobalConsts.UpdateSetupLocation, FileMode.Create));
fs.BytesWritten += DownloadProgressChanged;
var latestVersionLink = await httpClient.GetAsync("https://raw.githubusercontent.com/dardizzola/LaMuccaRossaVideoDownloader/master/LaMuccaRossaVideoDownloader/latestVersionLink.txt").ConfigureAwait(false);
var latestVersionLink = await httpClient.GetAsync("https://raw.githubusercontent.com/dardizzola/LaMuccaRossaVideoDownloader/main/LaMuccaRossaVideoDownloader/latestVersionLink.txt").ConfigureAwait(false);
var response = await httpClient.GetAsync(await latestVersionLink.Content.ReadAsStringAsync().ConfigureAwait(false)).ConfigureAwait(false);
await Dispatcher.InvokeAsync(() => CurrentDownloadProgressBar.Maximum = response.Content.Headers.ContentLength ?? 0);
await response.Content.CopyToAsync(fs, cancellationTokenSource.Token).ContinueWith(async a =>
Expand Down
Loading

0 comments on commit 247b7cc

Please sign in to comment.