Updater fixes

This commit is contained in:
Squid Grill 2020-11-15 14:42:55 -06:00
parent 3bfadf6a14
commit 2f91946ff7
3 changed files with 8 additions and 4 deletions

View file

@ -15,9 +15,9 @@ namespace FRESHMusicPlayer.Handlers
{
public class UpdateHandler
{
public static async Task UpdateApp(bool useDeltaPatching = true)
public static async Task UpdateApp(bool useDeltaPatching = true, bool forceUpdate = false)
{
if (App.Config.UpdateMode == UpdateMode.Manual) return;
if (App.Config.UpdateMode == UpdateMode.Manual && forceUpdate) return;
// Updater not present, probably standalone
if (!File.Exists(Path.Combine(Path.GetFullPath(Path.Combine(Path.GetDirectoryName(Assembly.GetEntryAssembly().Location), @"../")), "Update.exe"))) return;
App.Config.UpdatesLastChecked = DateTime.Now;

View file

@ -60,7 +60,7 @@ namespace FRESHMusicPlayer.Pages.Library
});
var lengthTimeSpan = new TimeSpan(0, 0, 0, length);
InfoLabel.Visibility = Visibility.Visible;
InfoLabel.Text = $@"{Properties.Resources.MAINWINDOW_TRACKS}: {TracksPanel.Items.Count} ・ {Math.Round(lengthTimeSpan.TotalHours)}:{lengthTimeSpan:mm}:{lengthTimeSpan:ss}";
InfoLabel.Text = $@"{Properties.Resources.MAINWINDOW_TRACKS}: {TracksPanel.Items.Count} ・ {Math.Floor(lengthTimeSpan.TotalHours)}:{lengthTimeSpan:mm}:{lengthTimeSpan:ss}";
}
public async void ShowArtists()
{

View file

@ -193,7 +193,11 @@ namespace FRESHMusicPlayer.Pages
WinForms.Application.Restart();
}
private async void Updates_CheckUpdatesButton_Click(object sender, RoutedEventArgs e) => await UpdateHandler.UpdateApp();
private async void Updates_CheckUpdatesButton_Click(object sender, RoutedEventArgs e)
{
await UpdateHandler.UpdateApp(forceUpdate:true);
InitFields();
}
}
public enum LanguageCombo
{