Compare commits

..

14 Commits

Author SHA1 Message Date
Robert
bdae155af6 incr ver 2025-12-11 16:41:36 -05:00
rmcrackan
c8b44193ac Merge pull request #1490 from Mbucari/master
Two bugfixes
2025-12-09 13:39:14 -05:00
Mbucari
9545b3a874 Invoke MessageBox on UI thread 2025-12-06 18:55:38 -07:00
Mbucari
e932c9fab9 Merge branch 'rmcrackan:master' into master 2025-12-06 18:02:38 -07:00
Robert
c8f4c1e751 Merge branch 'master' of https://github.com/rmcrackan/Libation 2025-12-06 14:48:26 -05:00
Robert
0303db153f update audibleapi 2025-12-06 14:48:24 -05:00
Mbucari
a7e9479eab Fix file utility modifying file extension using replacement character
The file extension should not be subject to renaming. #1483
2025-12-06 10:40:02 -07:00
Mbucari
d339dbc906 Update macOS install instructions. 2025-12-05 21:06:02 -07:00
Robert
5fe6f931ad incr ver 2025-12-04 20:54:08 -05:00
rmcrackan
ca9fe9fc32 Merge pull request #1479 from Mbucari/master
Two minor bug fixes
2025-12-04 20:52:19 -05:00
MBucari
986dbd678f Don't throw exceptions from failure to delete db-wal and db-shm files (#1478) 2025-12-03 22:09:35 -07:00
MBucari
ea3716f48a Fix books dialog not saving or updating properly (#1477) 2025-12-03 22:03:14 -07:00
rmcrackan
426d5a87b4 Merge pull request #1476 from rmcrackan/dependabot/github_actions/apple-actions/import-codesign-certs-6
Bump apple-actions/import-codesign-certs from 5 to 6
2025-12-03 09:48:46 -05:00
dependabot[bot]
c893bbe52e Bump apple-actions/import-codesign-certs from 5 to 6
Bumps [apple-actions/import-codesign-certs](https://github.com/apple-actions/import-codesign-certs) from 5 to 6.
- [Release notes](https://github.com/apple-actions/import-codesign-certs/releases)
- [Commits](https://github.com/apple-actions/import-codesign-certs/compare/v5...v6)

---
updated-dependencies:
- dependency-name: apple-actions/import-codesign-certs
  dependency-version: '6'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-12-03 14:06:28 +00:00
11 changed files with 52 additions and 66 deletions

View File

@@ -34,7 +34,7 @@ jobs:
RUNTIME_ID: "osx-${{ inputs.architecture }}"
WAIT_FOR_NOTARIZE: ${{ vars.WAIT_FOR_NOTARIZE == 'true' }}
steps:
- uses: apple-actions/import-codesign-certs@v5
- uses: apple-actions/import-codesign-certs@v6
if: ${{ inputs.sign-app }}
with:
p12-file-base64: ${{ secrets.DISTRIBUTION_SIGNING_CERT }}

View File

@@ -13,51 +13,14 @@ This walkthrough should get you up and running with Libation on your Mac.
## Install Libation
- Download the file from the latest release and extract it.
- Apple Silicon (M1, M2, ...): `Libation.x.x.x-macOS-chardonnay-`**arm64**`.tgz`
- Intel: `Libation.x.x.x-macOS-chardonnay-`**x64**`.tgz`
- Move the extracted Libation app bundle to your applications folder.
- Right-click on Libation and then click on open
- The first time, it will not immediately show you an option to open it. Just dismiss the dialog and do the same thing again (right-click -> open) then you will get an option to run the unsigned application. This takes about 10 seconds.
- Apple Silicon (M1, M2, ...): `Libation.x.x.x-macOS-chardonnay-`**arm64**`.dmg`
- Intel: `Libation.x.x.x-macOS-chardonnay-`**x64**`.dmg`
- Mount the dmg and open the disk folder (should open automatically). Drag-drop the Libation app into your Applications folder.
## If this doesn't work
![macOS-drag-drop-install](images/macOS-drag-drop-install.png)
- Go to your applications folder and double-click Libation to start it. The first time you run Libation, you'll be asked if you want to run this program downloaded from the internet. Click "Open".
You can add Libation as a safe app without touching Gatekeeper.
- Copy/paste/run the following command. Adjust the file path to the Libation.app on your computer if necessary.
```Console
xattr -r -d com.apple.quarantine ~/Downloads/Libation.app
```
- Close the terminal and use Libation!
## If this still doesn't work
- Copy/paste/run the following command (you'll be prompted to enter your Mac password)
```Console
sudo spctl --master-disable && sudo spctl --add --label "Libation" /Applications/Libation.app && open /Applications/Libation.app && sudo spctl --master-enable
```
* Close the terminal and use Libation!
## "Apple can't check app for malicious software"
From: [How to Open Anyway](https://support.apple.com/guide/mac-help/apple-cant-check-app-for-malicious-software-mchleab3a043/mac):
* On your Mac, choose Apple menu > System Settings, then click Privacy & Security in the sidebar. (You may need to scroll down.)
* Go to Security, then click Open.
* Click Open Anyway. This button is available for about an hour after you try to open the app.
* Enter your login password, then click OK.
## Troubleshooting
If Libation fails to start after completing the above steps, try the following:
1. Right-click the Libation app in your applications folder and select _Show Package Contents_
2. Open the `Contents` folder and then the `MacOS` folder.
3. Find the file named `Libation`, right-click it, and then select _Open_.
Libation _should_ launch, and you should now be able to open Libation by just double-clicking the app bundle in your applications folder.
![macOS-libation-first-run](images/macOS-libation-first-run.png)
## Running Hangover

View File

Binary file not shown.

After

Width:  |  Height:  |  Size: 73 KiB

View File

Binary file not shown.

After

Width:  |  Height:  |  Size: 50 KiB

View File

@@ -2,7 +2,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net10.0</TargetFramework>
<Version>12.8.0.1</Version>
<Version>12.8.2.1</Version>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Octokit" Version="14.0.0" />

View File

@@ -105,15 +105,35 @@ namespace AppScaffolding
/// <summary>
/// Delete shared memory and write-ahead log SQLite database files which may prevent access to the database.
/// These file may or may not cause libation to hang on CreateContext,
/// so try our luck by swallowing any exceptions and continuing.
/// </summary>
private static void DeleteOpenSqliteFiles(Configuration config)
{
var walFile = SqliteStorage.DatabasePath + "-wal";
var shmFile = SqliteStorage.DatabasePath + "-shm";
if (File.Exists(walFile))
FileManager.FileUtility.SaferDelete(walFile);
{
try
{
FileManager.FileUtility.SaferDelete(walFile);
}
catch(Exception ex)
{
Log.Logger.Warning(ex, "Could not delete SQLite WAL file: {@WalFile}", walFile);
}
}
if (File.Exists(shmFile))
FileManager.FileUtility.SaferDelete(shmFile);
{
try
{
FileManager.FileUtility.SaferDelete(shmFile);
}
catch (Exception ex)
{
Log.Logger.Warning(ex, "Could not delete SQLite SHM file: {@ShmFile}", shmFile);
}
}
}
/// <summary>Initialize logging. Wire-up events. Run after migration</summary>

View File

@@ -5,8 +5,8 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="AudibleApi" Version="10.1.1.1" />
<PackageReference Include="Google.Protobuf" Version="3.33.1" />
<PackageReference Include="AudibleApi" Version="10.1.2.1" />
<PackageReference Include="Google.Protobuf" Version="3.33.2" />
</ItemGroup>
<ItemGroup>

View File

@@ -56,15 +56,18 @@ namespace FileManager
fileExtension = GetStandardizedExtension(fileExtension);
// remove invalid chars
path = GetSafePath(path, replacements);
var pathStr = removeInvalidWhitespace(path.Path);
var pathWithoutExtension = pathStr.EndsWithInsensitive(fileExtension)
? pathStr[..^fileExtension.Length]
: path.Path;
// remove invalid chars, but leave file extension untouched
pathWithoutExtension = GetSafePath(pathWithoutExtension, replacements);
// ensure uniqueness and check lengths
var dir = Path.GetDirectoryName(path)?.TruncateFilename(LongPath.MaxDirectoryLength) ?? string.Empty;
var dir = Path.GetDirectoryName(pathWithoutExtension)?.TruncateFilename(LongPath.MaxDirectoryLength) ?? string.Empty;
var fileName = Path.GetFileName(path);
var extIndex = fileName.LastIndexOf(fileExtension, StringComparison.OrdinalIgnoreCase);
var filenameWithoutExtension = extIndex >= 0 ? fileName.Remove(extIndex, fileExtension.Length) : fileName;
var filenameWithoutExtension = Path.GetFileName(pathWithoutExtension);
var fileStem
= Path.Combine(dir, filenameWithoutExtension.TruncateFilename(LongPath.MaxFilenameLength - fileExtension.Length))
.TruncateFilename(LongPath.MaxPathLength - fileExtension.Length);

View File

@@ -90,6 +90,7 @@ namespace LibationAvalonia
/// <param name="caption">The text to display in the title bar of the message box.</param>
/// <param name="exception">Exception to log.</param>
public static async Task ShowAdminAlert(Window? owner, string text, string caption, Exception exception)
=> await Dispatcher.UIThread.InvokeAsync(async () =>
{
// for development and debugging, show me what broke!
if (System.Diagnostics.Debugger.IsAttached)
@@ -105,7 +106,7 @@ namespace LibationAvalonia
var form = new MessageBoxAlertAdminDialog(text, caption, exception);
await DisplayWindow(form, owner);
}
});
private static async Task<DialogResult> ShowCoreAsync(Window? owner, string message, string caption, MessageBoxButtons buttons, MessageBoxIcon icon, MessageBoxDefaultButton defaultButton, bool saveAndRestorePosition = true)
=> await Dispatcher.UIThread.InvokeAsync(async () =>

View File

@@ -1,6 +1,7 @@
using System;
using System.Linq;
using System.Windows.Forms;
using ApplicationServices;
using DataLayer;
using Dinah.Core;
using LibationFileManager;
@@ -83,7 +84,7 @@ namespace LibationWinForms.Dialogs
{
{
var status = Book.UserDefinedItem.BookStatus;
this.bookLiberatedCb.Items.Clear();
this.bookLiberatedCb.Items.Add(new liberatedComboBoxItem { Status = LiberatedStatus.Liberated, Text = "Downloaded" });
this.bookLiberatedCb.Items.Add(new liberatedComboBoxItem { Status = LiberatedStatus.NotLiberated, Text = "Not Downloaded" });
@@ -96,10 +97,9 @@ namespace LibationWinForms.Dialogs
{
var status = Book.UserDefinedItem.PdfStatus;
if (status is null)
this.pdfLiberatedCb.Enabled = false;
else
this.pdfLiberatedCb.Items.Clear();
this.pdfLiberatedCb.Enabled = status is not null;
if (status is not null)
{
this.pdfLiberatedCb.Items.Add(new liberatedComboBoxItem { Status = LiberatedStatus.Liberated, Text = "Downloaded" });
this.pdfLiberatedCb.Items.Add(new liberatedComboBoxItem { Status = LiberatedStatus.NotLiberated, Text = "Not Downloaded" });
@@ -123,16 +123,17 @@ namespace LibationWinForms.Dialogs
comboBox.SelectedIndex = 0;
}
private void saveBtn_Click(object sender, EventArgs e)
private async void saveBtn_Click(object sender, EventArgs e)
{
NewTags = this.newTagsTb.Text;
BookLiberatedStatus = ((liberatedComboBoxItem)this.bookLiberatedCb.SelectedItem).Status;
if (this.pdfLiberatedCb.Enabled)
PdfLiberatedStatus = ((liberatedComboBoxItem)this.pdfLiberatedCb.SelectedItem).Status;
this.DialogResult = DialogResult.OK;
Invoke(() => saveBtn.Enabled = cancelBtn.Enabled = false);
await LibraryBook.UpdateUserDefinedItemAsync(NewTags, BookLiberatedStatus, PdfLiberatedStatus);
Invoke(() => saveBtn.Enabled = cancelBtn.Enabled = true);
}
private void cancelBtn_Click(object sender, EventArgs e)

View File

@@ -109,8 +109,6 @@ namespace LibationWinForms.GridView
{
bookDetailsForm.FormClosed -= bookDetailsForm_FormClosed;
bookDetailsForm.SaveSizeAndLocation(Configuration.Instance);
if (e.CloseReason is CloseReason.UserClosing && bookDetailsForm.DialogResult is DialogResult.OK)
await liveGridEntry.LibraryBook.UpdateUserDefinedItemAsync(bookDetailsForm.NewTags, bookDetailsForm.BookLiberatedStatus, bookDetailsForm.PdfLiberatedStatus);
}
}