Skip to content

Commit

Permalink
Release 1.8.5 (#90)
Browse files Browse the repository at this point in the history
  • Loading branch information
DSPaul authored Feb 16, 2025
2 parents fc126ef + e909177 commit 57255cb
Show file tree
Hide file tree
Showing 14 changed files with 43 additions and 26 deletions.
9 changes: 8 additions & 1 deletion Changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# CHANGELOG
## COMPASS v1.8.4 (12 February 2025)
## COMPASS v1.8.5 (16 February 2025)

### Fixes
- Fix transparency issues then generating thumbnail from pdf (thanks @anthony-bernaert)
- Fix issues with downloading cover for google drive files
- Fix title scraped from websites containing html codes
- Fix crash when selecting an item with a corrupt cover art file
## COMPASS v1.8.4 (12 February 2025)

### Fixes
- Fix crash when trying to import an unauthorized folder
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.4"
#define MyAppVersion "1.8.5"
#define MyAppPublisher "Paul De Smul"
#define MyAppURL "https://www.compassapp.info"
#define MyAppExeName "COMPASS.exe"
Expand Down
10 changes: 0 additions & 10 deletions src/COMPASS.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@
<ItemGroup>
<None Remove="Media\CompassLogo.png" />
<None Remove="gs\gsdll64.dll" />
<None Remove="gs\gsdll64.lib" />
<None Remove="gs\gswin64.exe" />
<None Remove="gs\gswin64c.exe" />
</ItemGroup>

Expand All @@ -28,14 +26,6 @@
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>

<Content Include="gs\gsdll64.lib">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>

<Content Include="gs\gswin64.exe">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>

<Content Include="gs\gswin64c.exe">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
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.4")]
[assembly: AssemblyVersion("1.8.5")]
[assembly: System.Runtime.Versioning.SupportedOSPlatform("windows")]


2 changes: 2 additions & 0 deletions src/Services/IOService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ public static class IOService
public static async Task<byte[]> DownloadFileAsync(string uri)
{
using HttpClient client = new();
// Set headers to mimic a browser, gets around some auth issues
client.DefaultRequestHeaders.UserAgent.ParseAdd("Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.93 Safari/537.36");

if (!Uri.TryCreate(uri, UriKind.Absolute, out Uri? _)) throw new InvalidOperationException("URI is invalid.");
try
Expand Down
7 changes: 4 additions & 3 deletions src/ViewModels/Sources/GenericOnlineSourceViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
using HtmlAgilityPack;
using System;
using System.Diagnostics;
using System.Net;
using System.Threading.Tasks;

namespace COMPASS.ViewModels.Sources
Expand Down Expand Up @@ -36,17 +37,17 @@ public override async Task<CodexDto> GetMetaData(SourceSet sources)
CodexDto codex = new();

// Title
codex.Title = src.SelectSingleNode("//meta[@property='og:title']")?.GetAttributeValue("content", null) ?? codex.Title;
codex.Title = WebUtility.HtmlDecode(src.SelectSingleNode("//meta[@property='og:title']")?.GetAttributeValue("content", null) ?? codex.Title);

// Authors
string? author = src.SelectSingleNode("//meta[@property='og:author']")?.GetAttributeValue("content", String.Empty);
string? author = WebUtility.HtmlDecode(src.SelectSingleNode("//meta[@property='og:author']")?.GetAttributeValue("content", String.Empty));
if (!String.IsNullOrEmpty(author))
{
codex.Authors = new() { author };
}

// Description
codex.Description = src.SelectSingleNode("//meta[@property='og:description']")?.GetAttributeValue("content", null) ?? codex.Description;
codex.Description = WebUtility.HtmlDecode(src.SelectSingleNode("//meta[@property='og:description']")?.GetAttributeValue("content", null) ?? codex.Description);

// Tags
foreach (var folderTagPair in TargetCollection.Info.FolderTagPairs)
Expand Down
25 changes: 20 additions & 5 deletions src/ViewModels/Sources/GoogleDriveSourceViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,26 @@ public override async Task<bool> FetchCover(Codex codex)
HtmlNode? src = doc?.DocumentNode;
if (src is null) return false;

string imgURL = src.SelectSingleNode("//meta[@property='og:image']").GetAttributeValue("content", String.Empty);
//cut of "=W***-h***-p" from URL that crops the image if it is present
if (imgURL.Contains('=')) imgURL = imgURL.Split('=')[0];
await CoverService.SaveCover(imgURL, codex);
return true;
string imgURL = "";
if (src.SelectSingleNode("//meta[@property='og:image']") is HtmlNode imgNode)
{
imgURL = imgNode.GetAttributeValue("content", String.Empty);
//cut of "=W***-h***-p" from URL that crops the image if it is present
if (imgURL.Contains('=')) imgURL = imgURL.Split('=')[0];
}

else if (src.SelectSingleNode("//link[@id='texmex-thumb']") is HtmlNode linkNode)
{
imgURL = linkNode.GetAttributeValue("href", String.Empty);
}

if (!string.IsNullOrEmpty(imgURL))
{
await CoverService.SaveCover(imgURL, codex);
return true;
}

return false;
}
catch (Exception ex)
{
Expand Down
6 changes: 4 additions & 2 deletions src/ViewModels/Sources/PdfSourceViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,10 @@ public override async Task<bool> FetchCover(Codex codex)
{
await image.ReadAsync(codex.Sources.Path, ReadSettings);
image.Format = MagickFormat.Png;
image.BackgroundColor = new MagickColor("#000000"); //set background color as transparent
image.Trim(); //cut off all transparency

//some pdf's are transparent, expecting a white page underneath
image.BackgroundColor = new MagickColor("#FFFFFF");
image.Alpha(AlphaOption.Remove);

await image.WriteAsync(codex.CoverArt);
CoverService.CreateThumbnail(codex, image);
Expand Down
2 changes: 1 addition & 1 deletion src/Views/CodexInfoView.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@
Width="200" Height="270" Margin="10">
<Border.Background>
<ImageBrush ImageSource="{Binding CoverArt, IsAsync=True ,Converter={StaticResource UriToBitmapConverter},
Mode=OneWay, TargetNullValue=Media\\CoverPlaceholder.png}"/>
ConverterParameter=True, Mode=OneWay, TargetNullValue=Media\\CoverPlaceholder.png}"/>
</Border.Background>
<Border.Effect>
<DropShadowEffect BlurRadius="10" ShadowDepth="0"/>
Expand Down
Binary file modified src/gs/gsdll64.dll
Binary file not shown.
Binary file removed src/gs/gsdll64.lib
Binary file not shown.
Binary file removed src/gs/gswin64.exe
Binary file not shown.
Binary file modified src/gs/gswin64c.exe
Binary file not shown.
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.4</version>
<url>https://github.com/DSPAUL/COMPASS/releases/download/v1.8.4/COMPASS_Setup_1.8.4.exe</url>
<version>1.8.5</version>
<url>https://github.com/DSPAUL/COMPASS/releases/download/v1.8.5/COMPASS_Setup_1.8.5.exe</url>
<mandatory>false</mandatory>
</item>

0 comments on commit 57255cb

Please sign in to comment.