Skip to content

Commit

Permalink
Release 1.8.3 (#88)
Browse files Browse the repository at this point in the history
  • Loading branch information
DSPaul authored Dec 20, 2024
2 parents feac3a9 + 474deb0 commit 3cae58d
Show file tree
Hide file tree
Showing 17 changed files with 68 additions and 42 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/package.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
- name: Setup .NET Core
uses: actions/setup-dotnet@v4
with:
dotnet-version: 7.0.x
dotnet-version: 9.0.x

- name: Install dependencies
run: dotnet restore
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ on:
- '**.csproj'

env:
DOTNET_VERSION: '7.0.x' # The .NET SDK version to use
DOTNET_VERSION: '9.0.x' # The .NET SDK version to use

jobs:
build-and-test:
Expand Down
12 changes: 11 additions & 1 deletion Changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
# CHANGELOG
## COMPASS v1.8.2 (01 November 2024)
## COMPASS v1.8.3 (20 December 2024)

### Fixes
- Fix recovery flow if COMPASS cannot write to default appdata location
- Fix a crash when browsing a file on a drive that no longer exists
- Fix two potential crashes when moving an item between collections
- Fix a potentional crash when runnen COMPASS on a single core CPU

### Other
Upgrade to .NET 9
## COMPASS v1.8.2 (01 November 2024)

### New Features

Expand Down
2 changes: 1 addition & 1 deletion Deployment/install.iss
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!

#define MyAppName "COMPASS"
#define MyAppVersion "1.8.2"
#define MyAppVersion "1.8.3"
#define MyAppPublisher "Paul De Smul"
#define MyAppURL "https://www.compassapp.info"
#define MyAppExeName "COMPASS.exe"
Expand Down
2 changes: 1 addition & 1 deletion Tests/Tests.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net7.0-windows</TargetFramework>
<TargetFramework>net9.0-windows7.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>

Expand Down
9 changes: 3 additions & 6 deletions src/App.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
using COMPASS.Interfaces;
using COMPASS.Models.Enums;
using COMPASS.Services;
using COMPASS.Tools;
using COMPASS.ViewModels;
using System;
using System.IO;
Expand All @@ -24,12 +23,10 @@ public App()
Directory.CreateDirectory(SettingsViewModel.CompassDataPath);
}
}
catch (Exception ex)
catch (Exception)
{
Logger.Error($"Failed to create folder at compass data path, so data cannot be saved", ex);
string msg = $"Failed to create a folder to store user data at {SettingsViewModel.CompassDataPath}, " +
$"please pick a new location to save your data. Creation failed with the following error {ex.Message}";
IOService.AskNewCodexFilePath(msg);
//Cannot show notification here because app needs to finish its constructor before any UI can be shown,
//Cannot log either because the log file is located in the CompassDataPath directory
}
}

Expand Down
26 changes: 13 additions & 13 deletions src/COMPASS.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<OutputType>WinExe</OutputType>
<TargetFramework>net7.0-windows</TargetFramework>
<TargetFramework>net9.0-windows</TargetFramework>
<UseWPF>true</UseWPF>
<RootNamespace>COMPASS</RootNamespace>
<AssemblyName>COMPASS</AssemblyName>
Expand Down Expand Up @@ -65,23 +65,23 @@
<PackageReference Include="DotNetSeleniumExtras.WaitHelpers" Version="3.11.0" />
<PackageReference Include="FuzzySharp" Version="2.0.2" />
<PackageReference Include="gong-wpf-dragdrop" Version="3.2.1" />
<PackageReference Include="HtmlAgilityPack" Version="1.11.67" />
<PackageReference Include="itext7" Version="8.0.5" />
<PackageReference Include="itext7.bouncy-castle-adapter" Version="8.0.5" />
<PackageReference Include="log4net" Version="2.0.17" />
<PackageReference Include="Magick.NET-Q8-AnyCPU" Version="14.0.0" />
<PackageReference Include="Magick.NET.SystemDrawing" Version="8.0.0" />
<PackageReference Include="HtmlAgilityPack" Version="1.11.71" />
<PackageReference Include="itext7" Version="9.0.0" />
<PackageReference Include="itext7.bouncy-castle-adapter" Version="9.0.0" />
<PackageReference Include="log4net" Version="3.0.3" />
<PackageReference Include="Magick.NET-Q8-AnyCPU" Version="14.2.0" />
<PackageReference Include="Magick.NET.SystemDrawing" Version="8.0.2" />
<PackageReference Include="MaterialDesignThemes" Version="4.9.0" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
<PackageReference Include="Ookii.Dialogs.Wpf" Version="5.0.1" />
<PackageReference Include="OpenCvSharp4.Extensions" Version="4.10.0.20240616" />
<PackageReference Include="OpenCvSharp4.Windows" Version="4.10.0.20240616" />
<PackageReference Include="OpenCvSharp4.Extensions" Version="4.10.0.20241108" />
<PackageReference Include="OpenCvSharp4.Windows" Version="4.10.0.20241108" />
<PackageReference Include="ScrapySharp" Version="3.0.0" />
<PackageReference Include="Selenium.Support" Version="4.25.0" />
<PackageReference Include="Selenium.WebDriver" Version="4.25.0" />
<PackageReference Include="Selenium.Support" Version="4.27.0" />
<PackageReference Include="Selenium.WebDriver" Version="4.27.0" />
<PackageReference Include="SharpCompress" Version="0.38.0" />
<PackageReference Include="System.Drawing.Common" Version="8.0.10" />
<PackageReference Include="VirtualizingWrapPanel" Version="2.0.11" />
<PackageReference Include="System.Drawing.Common" Version="9.0.0" />
<PackageReference Include="VirtualizingWrapPanel" Version="2.1.0" />
<PackageReference Include="WpfAnimatedGif" Version="2.0.2" />
<PackageReference Include="ZXing.Net" Version="0.16.9" />
<PackageReference Include="ZXing.Net.Bindings.Windows.Compatibility" Version="0.16.12" />
Expand Down
2 changes: 1 addition & 1 deletion src/Models/CodexCollection.cs
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ public void InitAsNew()
CreateDirectories();
}

private void CreateDirectories()
public void CreateDirectories()
{
try
{
Expand Down
2 changes: 1 addition & 1 deletion src/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
// app, or any theme specific resource dictionaries)
)]

[assembly: AssemblyVersion("1.8.2")]
[assembly: AssemblyVersion("1.8.3")]
[assembly: System.Runtime.Versioning.SupportedOSPlatform("windows")]


2 changes: 1 addition & 1 deletion src/Properties/PublishProfiles/FolderProfile.pubxml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ https://go.microsoft.com/fwlink/?LinkID=208121.
<Platform>Any CPU</Platform>
<PublishDir>bin\Publish\win-x64</PublishDir>
<PublishProtocol>FileSystem</PublishProtocol>
<TargetFramework>net7.0-windows</TargetFramework>
<TargetFramework>net9.0-windows</TargetFramework>
<RuntimeIdentifier>win-x64</RuntimeIdentifier>
<SelfContained>false</SelfContained>
<PublishSingleFile>true</PublishSingleFile>
Expand Down
4 changes: 2 additions & 2 deletions src/Services/CoverService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ public static async Task GetCover(List<Codex> codices)

ParallelOptions parallelOptions = new()
{
MaxDegreeOfParallelism = Environment.ProcessorCount / 2
MaxDegreeOfParallelism = Math.Max(Environment.ProcessorCount / 2, 1)
};

try
Expand Down Expand Up @@ -227,7 +227,7 @@ public static IMagickImage GetCroppedScreenShot(IWebDriver driver, Point locatio
var mf = new MagickImageFactory();
using var img = mf.Create(ss.AsByteArray);
img.Resize(3000, 3000); //same size as headless window
return img.Clone(location.X, location.Y, (uint)size.Width, (uint)size.Height);
return img.CloneArea(location.X, location.Y, (uint)size.Width, (uint)size.Height);
}
}
}
8 changes: 7 additions & 1 deletion src/ViewModels/CodexEditViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,16 @@ public bool ShowLoading
public RelayCommand BrowsePathCommand => _browsePathCommand ??= new(BrowsePath);
private void BrowsePath()
{
string? initialDir = Path.GetDirectoryName(TempCodex.Sources.Path);
if (!Path.Exists(initialDir))
{
initialDir = string.Empty;
}

OpenFileDialog openFileDialog = new()
{
AddExtension = false,
InitialDirectory = Path.GetDirectoryName(TempCodex.Sources.Path) ?? String.Empty
InitialDirectory = initialDir
};
if (openFileDialog.ShowDialog() == true)
{
Expand Down
9 changes: 6 additions & 3 deletions src/ViewModels/CodexViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,9 @@ public static void MoveToCollection(CodexCollection targetCollection, List<Codex
windowedNotificationService.Show(errorNotification);
return;
}

//Make sure the directories exist before copying cover art into it
targetCollection.CreateDirectories();
foreach (Codex toMove in toMoveList)
{
toMove.Tags.Clear();
Expand All @@ -287,9 +290,9 @@ public static void MoveToCollection(CodexCollection targetCollection, List<Codex
tempCodex.SetImagePaths(targetCollection);

if (Path.Exists(toMove.CoverArt))
File.Copy(toMove.CoverArt, tempCodex.CoverArt);
File.Copy(toMove.CoverArt, tempCodex.CoverArt, true);
if (Path.Exists(toMove.CoverArt))
File.Copy(toMove.Thumbnail, tempCodex.Thumbnail);
File.Copy(toMove.Thumbnail, tempCodex.Thumbnail, true);

//Delete codex in original collection
MainViewModel.CollectionVM.CurrentCollection.DeleteCodex(toMove);
Expand Down Expand Up @@ -366,7 +369,7 @@ public static async Task StartGetMetaDataProcess(IList<Codex> codices)

ParallelOptions parallelOptions = new()
{
MaxDegreeOfParallelism = Environment.ProcessorCount / 2
MaxDegreeOfParallelism = Math.Max(Environment.ProcessorCount / 2, 1)
};

ChooseMetaDataViewModel chooseMetaDataVM = new();
Expand Down
6 changes: 3 additions & 3 deletions src/ViewModels/CollectionViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public CollectionViewModel(MainViewModel? mainViewModel)
{
Logger.Error($"Failed to create folder to store user data, so data cannot be saved", ex);
string msg = $"Failed to create a folder to store user data at {SettingsViewModel.CompassDataPath}, " +
$"please pick a new location to save your data. Creation failed with the following error {ex.Message}";
$"please pick a new location to save your data. Creation failed with the following error: '{ex.Message}'";
IOService.AskNewCodexFilePath(msg);
}

Expand Down Expand Up @@ -140,7 +140,7 @@ private void LoadInitialCollection()
{
Logger.Error($"Failed to create folder to store user data, so data cannot be saved", ex);
string msg = $"Failed to create a folder to store user data at {SettingsViewModel.CompassDataPath}, " +
$"please pick a new location to save your data. Creation failed with the following error {ex.Message}";
$"please pick a new location to save your data. Creation failed with the following error: '{ex.Message}'";
IOService.AskNewCodexFilePath(msg);
}
}
Expand All @@ -160,7 +160,7 @@ private void LoadInitialCollection()
else
{
//If no collections are found and creation fails, we are stuck in an infinite loop which is bad so throw and crash
throw new IOException("Could not create the default collection");
throw new IOException($"Could not create the default collection at {Path.Combine(CodexCollection.CollectionsPath, name)}");
}
}

Expand Down
16 changes: 13 additions & 3 deletions src/ViewModels/SettingsViewModel.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
using AutoUpdaterDotNET;
using Autofac;
using AutoUpdaterDotNET;
using CommunityToolkit.Mvvm.ComponentModel;
using CommunityToolkit.Mvvm.Input;
using COMPASS.Interfaces;
using COMPASS.Models;
using COMPASS.Models.CodexProperties;
using COMPASS.Models.Enums;
Expand Down Expand Up @@ -485,12 +487,17 @@ public bool SetNewDataPath(string newPath)

NewDataPath = newPath;

//Give users choice between moving or copying
//If there is existing data, Give users choice between moving or copying
if (Path.Exists(CompassDataPath))
{
ChangeDataLocationWindow window = new(this);
window.ShowDialog();
}
//If not, just change over
else
{
ChangeToNewDataPath();
}

return true;
}
Expand Down Expand Up @@ -542,10 +549,13 @@ private async Task CopyToNewDataPath()
/// </summary>
public void ChangeToNewDataPath()
{
MainViewModel.CollectionVM.CurrentCollection.Save();
MainViewModel.CollectionVM?.CurrentCollection.Save();

CompassDataPath = NewDataPath;

Notification changeSuccessful = new("Data path changed succesfully", $"Data path was successfully changed to {CompassDataPath}. COMPASS will now restart.");
App.Container.ResolveKeyed<INotificationService>(NotificationDisplayType.Windowed).Show(changeSuccessful);

//Restart COMPASS
var currentExecutablePath = Environment.ProcessPath;
var args = Environment.GetCommandLineArgs();
Expand Down
2 changes: 1 addition & 1 deletion src/Windows/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public MainWindow()
private void Window_Closing(object sender, CancelEventArgs e)
{
ProgressViewModel.GetInstance().CancelBackgroundTask();
MainViewModel.CollectionVM.CurrentCollection.Save();
MainViewModel.CollectionVM?.CurrentCollection.Save();
PreferencesService.GetInstance().SavePreferences();
}

Expand Down
4 changes: 2 additions & 2 deletions versionInfo.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<item>
<version>1.8.2</version>
<url>https://github.com/DSPAUL/COMPASS/releases/download/v1.8.2/COMPASS_Setup_1.8.2.exe</url>
<version>1.8.3</version>
<url>https://github.com/DSPAUL/COMPASS/releases/download/v1.8.3/COMPASS_Setup_1.8.3.exe</url>
<mandatory>false</mandatory>
</item>

0 comments on commit 3cae58d

Please sign in to comment.