Skip to content

Commit cfd302a

Browse files
committed
v3.0.4; fixes & minor improvements
1 parent c20a640 commit cfd302a

File tree

5 files changed

+27
-7
lines changed

5 files changed

+27
-7
lines changed

SmartImage 3/App/AppInfo.cs

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,16 +18,23 @@ internal static class AppInfo
1818
{
1919
internal static void ExceptionLog(Exception ex)
2020
{
21-
File.WriteAllLines($"smartimage.log", new[]
21+
var msg = new[]
2222
{
2323
$"Message: {ex.Message}",
2424
$"Source: {ex.Source}",
2525
$"Stack trace: {ex.StackTrace}",
2626

27-
});
27+
};
28+
File.WriteAllLines($"smartimage.log", msg);
29+
30+
foreach (var e in msg) {
31+
Console.Error.WriteLine(e);
32+
}
33+
34+
Console.ReadKey();
2835
}
2936

30-
internal static async Task<Release[]> GetRepoReleasesAsync()
37+
internal static async Task<Release[]?> GetRepoReleasesAsync()
3138
{
3239
var res = await "https://api.github.com/repos/Decimation/SmartImage/releases"
3340
.WithAutoRedirect(true)
@@ -36,6 +43,10 @@ internal static async Task<Release[]> GetRepoReleasesAsync()
3643
{
3744
User_Agent = HttpUtilities.UserAgent
3845
})
46+
.OnError(e =>
47+
{
48+
e.ExceptionHandled = true;
49+
})
3950
.GetJsonAsync<Release[]>();
4051

4152
return res;

SmartImage 3/Mode/Shell/ShellMode.Dialog.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,7 @@ private void ConfigDialog()
167167

168168
void ReloadDialog()
169169
{
170+
dtConfig.Dispose();
170171
tvConfig.Table = Config.ToTable();
171172
tvConfig.SetNeedsDisplay();
172173
dlCfg.SetNeedsDisplay();
@@ -396,7 +397,10 @@ Eh username/password
396397
Register
397398
\*============================================================================*/
398399

399-
btnRefresh.Clicked += ReloadDialog;
400+
btnRefresh.Clicked += () =>
401+
{
402+
403+
} ;
400404

401405
btnOk.Clicked += () =>
402406
{

SmartImage 3/Mode/Shell/ShellMode.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -516,6 +516,11 @@ public ShellMode(string[] args)
516516
private async void CheckForUpdates()
517517
{
518518
var releases = await AppInfo.GetRepoReleasesAsync();
519+
520+
if (releases == null) {
521+
return;
522+
}
523+
519524
var releases2 = releases.OrderByDescending(x => x.published_at);
520525

521526
var cv = Assembly.GetExecutingAssembly().GetName().Version;

SmartImage 3/SmartImage.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@
140140
</ItemGroup>
141141
<PropertyGroup>
142142
<PackageId>SmartImage</PackageId>
143-
<Version>3.0.3</Version>
143+
<Version>3.0.4</Version>
144144
<Authors>Read Stanton (Decimation)</Authors>
145145
<PackageTags>Image reverse search identification source sauce</PackageTags>
146146
<RepositoryUrl>https://github.com/Decimation/SmartImage</RepositoryUrl>

SmartImage 3/Utilities/ConsoleUtil.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,8 @@ internal static void SetConsoleMode()
5151
{
5252
// Clipboard.Open();
5353

54-
// Console.InputEncoding = Console.OutputEncoding = Encoding.UTF8;
55-
Console.InputEncoding = Console.OutputEncoding = Encoding.Unicode;
54+
Console.InputEncoding = Console.OutputEncoding = Encoding.UTF8;
55+
// Console.InputEncoding = Console.OutputEncoding = Encoding.Unicode;
5656

5757
Native.GetConsoleMode(StdIn, out ConsoleModes lpMode);
5858

0 commit comments

Comments
 (0)