update dependencies

This commit is contained in:
Robert McRackan 2021-09-03 23:02:28 -04:00
parent 437e85fd12
commit 126919d578
11 changed files with 42 additions and 45 deletions

View File

@ -6,7 +6,7 @@
<ItemGroup>
<PackageReference Include="AAXClean" Version="0.1.8" />
<PackageReference Include="Dinah.Core" Version="1.0.5.2" />
<PackageReference Include="Dinah.Core" Version="1.1.0.1" />
</ItemGroup>
</Project>

View File

@ -5,7 +5,7 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Dinah.Core" Version="1.0.5.2" />
<PackageReference Include="Dinah.Core" Version="1.1.0.1" />
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="5.0.0" />
<PackageReference Include="Octokit" Version="0.50.0" />
<PackageReference Include="Polly" Version="7.2.2" />

View File

@ -5,7 +5,7 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="AudibleApi" Version="1.1.5.1" />
<PackageReference Include="AudibleApi" Version="1.2.0.1" />
</ItemGroup>
<ItemGroup>

View File

@ -13,7 +13,7 @@
<!-- <PublishSingleFile>true</PublishSingleFile> -->
<RuntimeIdentifier>win-x64</RuntimeIdentifier>
<Version>5.6.5.1</Version>
<Version>5.6.5.5</Version>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">

View File

@ -9,6 +9,6 @@ namespace LibationWinForms
public event PropertyChangedEventHandler PropertyChanged;
public void NotifyPropertyChanged([CallerMemberName] string propertyName = "")
=> this.UIThread(() => PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName)));
=> this.UIThreadAsync(() => PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName)));
}
}

View File

@ -1,8 +1,8 @@
using DataLayer;
using System;
using DataLayer;
using Dinah.Core.Net.Http;
using Dinah.Core.Windows.Forms;
using Dinah.Core.Threading;
using LibationWinForms.BookLiberation.BaseForms;
using System;
namespace LibationWinForms.BookLiberation
{
@ -47,7 +47,7 @@ namespace LibationWinForms.BookLiberation
if (downloadProgress.ProgressPercentage == 0)
updateRemainingTime(0);
else
progressBar1.UIThread(() => progressBar1.Value = (int)downloadProgress.ProgressPercentage);
progressBar1.UIThreadAsync(() => progressBar1.Value = (int)downloadProgress.ProgressPercentage);
}
public override void OnStreamingTimeRemaining(object sender, TimeSpan timeRemaining)
@ -61,7 +61,7 @@ namespace LibationWinForms.BookLiberation
public override void OnTitleDiscovered(object sender, string title)
{
this.UIThread(() => this.Text = DecodeActionName + " " + title);
this.UIThreadAsync(() => this.Text = DecodeActionName + " " + title);
this.title = title;
updateBookInfo();
}
@ -79,14 +79,14 @@ namespace LibationWinForms.BookLiberation
}
public override void OnCoverImageDiscovered(object sender, byte[] coverArt)
=> pictureBox1.UIThread(() => pictureBox1.Image = Dinah.Core.Drawing.ImageReader.ToImage(coverArt));
=> pictureBox1.UIThreadAsync(() => pictureBox1.Image = Dinah.Core.Drawing.ImageReader.ToImage(coverArt));
#endregion
// thread-safe UI updates
private void updateBookInfo()
=> bookInfoLbl.UIThread(() => bookInfoLbl.Text = $"{title}\r\nBy {authorNames}\r\nNarrated by {narratorNames}");
=> bookInfoLbl.UIThreadAsync(() => bookInfoLbl.Text = $"{title}\r\nBy {authorNames}\r\nNarrated by {narratorNames}");
private void updateRemainingTime(int remaining)
=> remainingTimeLbl.UIThread(() => remainingTimeLbl.Text = $"ETA:\r\n{remaining} sec");
=> remainingTimeLbl.UIThreadAsync(() => remainingTimeLbl.Text = $"ETA:\r\n{remaining} sec");
}
}

View File

@ -1,7 +1,6 @@
using Dinah.Core.Windows.Forms;
using System;
using System.Linq;
using System;
using System.Windows.Forms;
using Dinah.Core.Threading;
namespace LibationWinForms.BookLiberation
{
@ -19,7 +18,7 @@ namespace LibationWinForms.BookLiberation
public void WriteLine(string text)
{
if (!IsDisposed)
logTb.UIThread(() => logTb.AppendText($"{DateTime.Now} {text}{Environment.NewLine}"));
logTb.UIThreadAsync(() => logTb.AppendText($"{DateTime.Now} {text}{Environment.NewLine}"));
}
public void FinalizeUI()

View File

@ -1,9 +1,9 @@
using DataLayer;
using System;
using System.Windows.Forms;
using DataLayer;
using Dinah.Core.Net.Http;
using Dinah.Core.Threading;
using FileLiberator;
using System;
using System.Windows.Forms;
namespace LibationWinForms.BookLiberation.BaseForms
{
@ -122,8 +122,8 @@ namespace LibationWinForms.BookLiberation.BaseForms
/// <summary>
/// If the form was shown using Show (not ShowDialog), Form.Close calls Form.Dispose
/// </summary>
private void OnStreamingCompletedClose(object sender, string completedString) => this.UIThread(Close);
private void OnCompletedDispose(object sender, LibraryBook e) => this.UIThread(Dispose);
private void OnStreamingCompletedClose(object sender, string completedString) => this.UIThreadAsync(Close);
private void OnCompletedDispose(object sender, LibraryBook e) => this.UIThreadAsync(Dispose);
/// <summary>
/// If StreamingBegin is fired from a worker thread, the window will be created on that
@ -132,7 +132,7 @@ namespace LibationWinForms.BookLiberation.BaseForms
/// could cause it to freeze. Form.BeginInvoke won't work until the form is created
/// (ie. shown) because Control doesn't get a window handle until it is Shown.
/// </summary>
private void OnStreamingBeginShow(object sender, string beginString) => Invoker.UIThread(Show);
private void OnStreamingBeginShow(object sender, string beginString) => Invoker.UIThreadAsync(Show);
#endregion

View File

@ -1,9 +1,8 @@
using Dinah.Core.Net.Http;
using Dinah.Core.Windows.Forms;
using LibationWinForms.BookLiberation.BaseForms;
using System;
using System.Linq;
using System;
using System.Windows.Forms;
using Dinah.Core.Net.Http;
using Dinah.Core.Threading;
using LibationWinForms.BookLiberation.BaseForms;
namespace LibationWinForms.BookLiberation
{
@ -21,7 +20,7 @@ namespace LibationWinForms.BookLiberation
#region IStreamable event handler overrides
public override void OnStreamingBegin(object sender, string beginString)
{
filenameLbl.UIThread(() => filenameLbl.Text = beginString);
filenameLbl.UIThreadAsync(() => filenameLbl.Text = beginString);
}
public override void OnStreamingProgressChanged(object sender, DownloadProgress downloadProgress)
{
@ -29,11 +28,11 @@ namespace LibationWinForms.BookLiberation
if (!downloadProgress.TotalBytesToReceive.HasValue || downloadProgress.TotalBytesToReceive.Value <= 0)
return;
progressLbl.UIThread(() => progressLbl.Text = $"{downloadProgress.BytesReceived:#,##0} of {downloadProgress.TotalBytesToReceive.Value:#,##0}");
progressLbl.UIThreadAsync(() => progressLbl.Text = $"{downloadProgress.BytesReceived:#,##0} of {downloadProgress.TotalBytesToReceive.Value:#,##0}");
var d = double.Parse(downloadProgress.BytesReceived.ToString()) / double.Parse(downloadProgress.TotalBytesToReceive.Value.ToString()) * 100.0;
var i = int.Parse(Math.Truncate(d).ToString());
progressBar1.UIThread(() => progressBar1.Value = i);
progressBar1.UIThreadAsync(() => progressBar1.Value = i);
lastDownloadProgress = DateTime.Now;
}
@ -50,14 +49,14 @@ namespace LibationWinForms.BookLiberation
private void timer_Tick(object sender, EventArgs e)
{
// if no update in the last 30 seconds, display frozen label
lastUpdateLbl.UIThread(() => lastUpdateLbl.Visible = lastDownloadProgress.AddSeconds(30) < DateTime.Now);
lastUpdateLbl.UIThreadAsync(() => lastUpdateLbl.Visible = lastDownloadProgress.AddSeconds(30) < DateTime.Now);
if (lastUpdateLbl.Visible)
{
var diff = DateTime.Now - lastDownloadProgress;
var min = (int)diff.TotalMinutes;
var minText = min > 0 ? $"{min}min " : "";
lastUpdateLbl.UIThread(() => lastUpdateLbl.Text = $"Frozen? Last download activity: {minText}{diff.Seconds}sec ago");
lastUpdateLbl.UIThreadAsync(() => lastUpdateLbl.Text = $"Frozen? Last download activity: {minText}{diff.Seconds}sec ago");
}
}
private void DownloadForm_FormClosing(object sender, FormClosingEventArgs e) => timer.Stop();

View File

@ -3,10 +3,9 @@ using System.Collections.Generic;
using System.Linq;
using System.Windows.Forms;
using ApplicationServices;
using DataLayer;
using Dinah.Core;
using Dinah.Core.Drawing;
using Dinah.Core.Windows.Forms;
using Dinah.Core.Threading;
using FileManager;
using InternalUtilities;
using LibationWinForms.Dialogs;
@ -134,11 +133,11 @@ namespace LibationWinForms
// suppressed filter while init'ing UI
var prev_isProcessingGridSelect = isProcessingGridSelect;
isProcessingGridSelect = true;
this.UIThread(() => setGrid());
this.UIThreadSync(() => setGrid());
isProcessingGridSelect = prev_isProcessingGridSelect;
// UI init complete. now we can apply filter
this.UIThread(() => doFilter(lastGoodFilter));
this.UIThreadAsync(() => doFilter(lastGoodFilter));
setBackupCounts(null, null);
}
@ -158,7 +157,7 @@ namespace LibationWinForms
currProductsGrid = new ProductsGrid { Dock = DockStyle.Fill };
currProductsGrid.VisibleCountChanged += setVisibleCount;
gridPanel.UIThread(() => gridPanel.Controls.Add(currProductsGrid));
gridPanel.UIThreadSync(() => gridPanel.Controls.Add(currProductsGrid));
currProductsGrid.Display();
}
ResumeLayout();
@ -229,9 +228,9 @@ namespace LibationWinForms
: "All books have been liberated";
// update UI
statusStrip1.UIThread(() => backupsCountsLbl.Text = statusStripText);
menuStrip1.UIThread(() => beginBookBackupsToolStripMenuItem.Enabled = pending > 0);
menuStrip1.UIThread(() => beginBookBackupsToolStripMenuItem.Text = string.Format(beginBookBackupsToolStripMenuItem_format, menuItemText));
statusStrip1.UIThreadAsync(() => backupsCountsLbl.Text = statusStripText);
menuStrip1.UIThreadAsync(() => beginBookBackupsToolStripMenuItem.Enabled = pending > 0);
menuStrip1.UIThreadAsync(() => beginBookBackupsToolStripMenuItem.Text = string.Format(beginBookBackupsToolStripMenuItem_format, menuItemText));
}
private void setPdfBackupCounts(LibraryCommands.LibraryStats libraryStats)
{
@ -251,9 +250,9 @@ namespace LibationWinForms
: "All PDFs have been downloaded";
// update UI
statusStrip1.UIThread(() => pdfsCountsLbl.Text = statusStripText);
menuStrip1.UIThread(() => beginPdfBackupsToolStripMenuItem.Enabled = libraryStats.pdfsNotDownloaded > 0);
menuStrip1.UIThread(() => beginPdfBackupsToolStripMenuItem.Text = string.Format(beginPdfBackupsToolStripMenuItem_format, menuItemText));
statusStrip1.UIThreadAsync(() => pdfsCountsLbl.Text = statusStripText);
menuStrip1.UIThreadAsync(() => beginPdfBackupsToolStripMenuItem.Enabled = libraryStats.pdfsNotDownloaded > 0);
menuStrip1.UIThreadAsync(() => beginPdfBackupsToolStripMenuItem.Text = string.Format(beginPdfBackupsToolStripMenuItem_format, menuItemText));
}
#endregion

View File

@ -13,7 +13,7 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Dinah.Core.WindowsDesktop" Version="1.0.5.1" />
<PackageReference Include="Dinah.Core.WindowsDesktop" Version="1.1.0.2" />
</ItemGroup>
<ItemGroup>