Add support for semantic versions and pre-releases (#2151)

This commit is contained in:
Mbucari
2026-11-12 16:59:08 -07:00
committed by GitHub
parent 2bf940527a
commit 09a97a8a22
38 changed files with 449 additions and 295 deletions

View File

@@ -71,7 +71,9 @@ jobs:
run: |
SCRIPT=./Scripts/Bundle_${{ inputs.OS }}.sh
chmod +rx ${SCRIPT}
${SCRIPT} ./bin "${{ inputs.libation-version }}" "${{ inputs.architecture }}"
# version string may be in semantic format, so replace '`' with '~' for *nix
VERSION=$(echo "${{ inputs.libation-version }}" | sed 's/-/~/g')
${SCRIPT} ./bin "$VERSION" "${{ inputs.architecture }}"
artifact=$(ls ./bundle)
echo "artifact=${artifact}" >> "${GITHUB_OUTPUT}"

View File

@@ -1,12 +1,12 @@
{
"WindowsClassic": "(?:Classic-Libation|Libation-Classic)\\.\\d+\\.\\d+\\.\\d+(?:\\.\\d+)?-win(?:dows)?-classic-x64\\.zip",
"WindowsAvalonia": "Libation\\.\\d+\\.\\d+\\.\\d+(?:\\.\\d+)?-win(?:dows)?-chardonnay-x64\\.zip",
"WindowsAvalonia_Arm64": "Libation\\.\\d+\\.\\d+\\.\\d+(?:\\.\\d+)?-win(?:dows)?-chardonnay-arm64\\.zip",
"LinuxAvalonia": "Libation\\.\\d+\\.\\d+\\.\\d+(?:\\.\\d+)?-linux-chardonnay-amd64\\.deb",
"LinuxAvalonia_DEB": "Libation\\.\\d+\\.\\d+\\.\\d+(?:\\.\\d+)?-linux-chardonnay-amd64\\.deb",
"LinuxAvalonia_RPM": "Libation\\.\\d+\\.\\d+\\.\\d+(?:\\.\\d+)?-linux-chardonnay-amd64\\.rpm",
"MacOSAvalonia": "Libation\\.\\d+\\.\\d+\\.\\d+(?:\\.\\d+)?-macOS-chardonnay-x64\\.dmg",
"LinuxAvalonia_Arm64": "Libation\\.\\d+\\.\\d+\\.\\d+(?:\\.\\d+)?-linux-chardonnay-arm64\\.deb",
"LinuxAvalonia_Arm64_RPM": "Libation\\.\\d+\\.\\d+\\.\\d+(?:\\.\\d+)?-linux-chardonnay-arm64\\.rpm",
"MacOSAvalonia_Arm64": "Libation\\.\\d+\\.\\d+\\.\\d+(?:\\.\\d+)?-macOS-chardonnay-arm64\\.dmg"
"WindowsClassic": "(?:Classic-Libation|Libation-Classic)\\.\\d+\\.\\d+\\.\\d+.*?-win(?:dows)?-classic-x64\\.zip",
"WindowsAvalonia": "Libation\\.\\d+\\.\\d+\\.\\d+.*?-win(?:dows)?-chardonnay-x64\\.zip",
"WindowsAvalonia_Arm64": "Libation\\.\\d+\\.\\d+\\.\\d+.*?-win(?:dows)?-chardonnay-arm64\\.zip",
"LinuxAvalonia": "Libation\\.\\d+\\.\\d+\\.\\d+.*?-linux-chardonnay-amd64\\.deb",
"LinuxAvalonia_DEB": "Libation\\.\\d+\\.\\d+\\.\\d+.*?-linux-chardonnay-amd64\\.deb",
"LinuxAvalonia_RPM": "Libation\\.\\d+\\.\\d+\\.\\d+.*?-linux-chardonnay-amd64\\.rpm",
"MacOSAvalonia": "Libation\\.\\d+\\.\\d+\\.\\d+.*?-macOS-chardonnay-x64\\.dmg",
"LinuxAvalonia_Arm64": "Libation\\.\\d+\\.\\d+\\.\\d+.*?-linux-chardonnay-arm64\\.deb",
"LinuxAvalonia_Arm64_RPM": "Libation\\.\\d+\\.\\d+\\.\\d+.*?-linux-chardonnay-arm64\\.rpm",
"MacOSAvalonia_Arm64": "Libation\\.\\d+\\.\\d+\\.\\d+.*?-macOS-chardonnay-arm64\\.dmg"
}

View File

@@ -127,7 +127,11 @@ echo "Set LSArchitecturePriority to $PLIST_ARCH"
# Portable sed -i (BSD sed on macOS requires backup arg; use .bak then remove)
sed -i.bak "s/ARCHITECTURE_STRING/$PLIST_ARCH/" $BUNDLE_CONTENTS/Info.plist && rm -f $BUNDLE_CONTENTS/Info.plist.bak
echo "Set CFBundleVersion to $VERSION"
VERSION_NUM=$(echo "$VERSION" | cut -d "-" -f 1)
echo "Set CFBundleVersion to $VERSION_NUM"
sed -i.bak "s/VERSION_NUM/$VERSION_NUM/" $BUNDLE_CONTENTS/Info.plist && rm -f $BUNDLE_CONTENTS/Info.plist.bak
echo "Set CFBundleShortVersionString to $VERSION"
sed -i.bak "s/VERSION_STRING/$VERSION/" $BUNDLE_CONTENTS/Info.plist && rm -f $BUNDLE_CONTENTS/Info.plist.bak
delfiles=('MacOSConfigApp' 'MacOSConfigApp.deps.json' 'MacOSConfigApp.runtimeconfig.json')

View File

@@ -142,9 +142,12 @@ $setupIcon = Join-Path $PSScriptRoot 'libation.ico'
if (-not (Test-Path $setupIcon)) {
throw "Installer icon not found: $setupIcon"
}
$VersionNum=$($Version -split "-")[0]
$iss = Join-Path $PSScriptRoot 'Libation.iss'
$defines = @(
"/DMyVersion=$Version",
"/DMyVersionNum=$VersionNum",
"/DMySetupIcon=$setupIcon",
"/DMyReleaseName=$releaseName",
"/DMyArchitecture=$Architecture",

View File

@@ -4,12 +4,15 @@
; Build-WindowsInstaller.ps1 for local builds; CI will pass the same defines.
;
; Required /D defines from build script:
; MyVersion, MyReleaseName, MyArchitecture, MySetupIcon,
; MyVersion, MyVersionNum, MyReleaseName, MyArchitecture, MySetupIcon,
; OutputBaseFilename, SourceDir, OutputDir, ArchitecturesAllowed
#ifndef MyVersion
#define MyVersion "0.0.0-dev"
#endif
#ifndef MyVersionNum
#define MyVersionNum "0.0.0.0"
#endif
#ifndef MyReleaseName
#define MyReleaseName "chardonnay"
#endif
@@ -70,7 +73,7 @@ WizardStyle=modern
SetupIconFile={#MySetupIcon}
UninstallDisplayIcon={app}\Libation.exe
UninstallDisplayName={#AppName}
VersionInfoVersion={#MyVersion}
VersionInfoVersion={#MyVersionNum}
VersionInfoProductName={#AppName}
VersionInfoCompany=Libation

View File

@@ -3,6 +3,7 @@
<PropertyGroup>
<TargetFramework>net10.0</TargetFramework>
<Version>14.2.5</Version>
<IncludeSourceRevisionInInformationalVersion>false</IncludeSourceRevisionInInformationalVersion>
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>

View File

@@ -5,6 +5,7 @@ using Dinah.Core.Logging;
using LibationFileManager;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using NuGet.Versioning;
using Serilog;
using System;
using System.Collections.Generic;
@@ -59,9 +60,8 @@ public static class LibationScaffolding
=> _entryAssembly ??= Assembly.GetEntryAssembly();
// previously: System.Reflection.Assembly.GetExecutingAssembly().GetName().Version;
private static Version? _buildVersion;
public static Version? BuildVersion
=> _buildVersion ??= new[] { ExecutingAssembly.GetName(), EntryAssembly?.GetName() }.Max(a => a?.Version);
private static NuGetVersion? _buildVersion;
public static NuGetVersion? BuildVersion => _buildVersion ??= GetAssemblyVersion();
/// <summary>Run migrations before loading Configuration for the first time. Then load and return Configuration</summary>
public static Configuration RunPreConfigMigrations()
@@ -82,6 +82,15 @@ public static class LibationScaffolding
return Configuration.Instance;
}
private static NuGetVersion? GetAssemblyVersion()
{
var verStr = ExecutingAssembly.GetCustomAttribute<AssemblyInformationalVersionAttribute>()?.InformationalVersion
?? EntryAssembly?.GetCustomAttribute<AssemblyInformationalVersionAttribute>()?.InformationalVersion;
return !string.IsNullOrEmpty(verStr) && NuGetVersion.TryParse(verStr, out var nugetVersion) ? nugetVersion
: new[] { ExecutingAssembly.GetName(), EntryAssembly?.GetName() }.Max(a => a?.Version != null ? new NuGetVersion(a.Version) : null);
}
/// <summary>most migrations go in here</summary>
public static void RunPostConfigMigrations(Configuration config, bool ephemeralSettings = false)
{
@@ -151,7 +160,7 @@ public static class LibationScaffolding
try
{
using var _ = new FileStream(path, FileMode.Open, FileAccess.ReadWrite, FileShare.None);
using var _ = new FileStream(path, System.IO.FileMode.Open, FileAccess.ReadWrite, FileShare.None);
return false;
}
catch (IOException)
@@ -388,42 +397,70 @@ public static class LibationScaffolding
private static volatile VersionCheckOutcome lastVersionCheckOutcome = VersionCheckOutcome.UnableToDetermine;
public static VersionCheckResult GetLatestRelease()
public static VersionCheckResult GetLatestRelease(bool includePreRelease)
{
var result = CheckLatestRelease();
var result = CheckLatestRelease(includePreRelease);
lastVersionCheckOutcome = result.Outcome;
return result;
}
private static VersionCheckResult CheckLatestRelease()
private static VersionCheckResult CheckLatestRelease(bool includePreRelease)
{
var (version, latest, zip, checkSucceeded, definitive) = getLatestRelease(TimeSpan.FromSeconds(10));
var releaseResult = getLatestReleaseWithRetry(TimeSpan.FromSeconds(10), includePreRelease);
if (!checkSucceeded || !definitive)
if (releaseResult is null)
return new VersionCheckResult(VersionCheckOutcome.UnableToDetermine);
if (version is null || latest is null || zip is null)
if (releaseResult.ReleaseVersion <= BuildVersion)
return new VersionCheckResult(VersionCheckOutcome.UpToDate);
if (releaseResult.Release is null || releaseResult.Asset is null)
return new VersionCheckResult(VersionCheckOutcome.UnableToDetermine);
// we have an update
var zipUrl = zip.BrowserDownloadUrl;
var upgradeProperties = releaseResult.ToUpgradeProperties();
Log.Logger.Information("Update available: {@DebugInfo}", new
{
latestRelease = version.ToString(),
latest.HtmlUrl,
zipUrl
latestRelease = releaseResult.ReleaseVersion.ToString(),
releaseResult.Release.HtmlUrl,
upgradeProperties.ZipUrl
});
return new VersionCheckResult(VersionCheckOutcome.UpdateAvailable, new UpgradeProperties(zipUrl, latest.HtmlUrl, zip.Name, version, latest.Body));
return new VersionCheckResult(VersionCheckOutcome.UpdateAvailable, upgradeProperties);
}
private static (Version? releaseVersion, Octokit.Release?, Octokit.ReleaseAsset? zip, bool checkSucceeded, bool definitive) getLatestRelease(TimeSpan timeout)
private record GitHubReleaseResult
{
public NuGetVersion ReleaseVersion { get; }
public Octokit.Release? Release { get; }
public Octokit.ReleaseAsset? Asset { get; }
public bool IsPrerelease => Release?.Prerelease ?? false;
public GitHubReleaseResult(NuGetVersion releaseVersion, Octokit.Release? latest = null, Octokit.ReleaseAsset? asset = null)
{
ReleaseVersion = releaseVersion;
Release = latest;
Asset = asset;
}
public UpgradeProperties ToUpgradeProperties()
=> Release is null || Asset is null ? throw new InvalidOperationException("Cannot convert to UpgradeProperties without Release and Asset")
: new UpgradeProperties(
Asset.BrowserDownloadUrl,
Release.HtmlUrl,
Asset.Name,
ReleaseVersion,
Release.Body,
IsPrerelease);
}
private static GitHubReleaseResult? getLatestReleaseWithRetry(TimeSpan timeout, bool includePreRelease)
{
try
{
var task = getLatestReleaseAsync();
var task = getLatestReleaseAsync(includePreRelease);
if (task.Wait(timeout))
return (task.Result.releaseVersion, task.Result.latest, task.Result.zip, true, task.Result.definitive);
return task.Result;
Log.Logger.Information("Version check timed out");
}
@@ -440,22 +477,48 @@ public static class LibationScaffolding
// different text to make it easier to identify in logs, vs the AggregateException case above
Log.Logger.Error(ex, "Version check failed. General exception");
}
return (null, null, null, false, false);
return null;
}
private static async System.Threading.Tasks.Task<(Version? releaseVersion, Octokit.Release? latest, Octokit.ReleaseAsset? zip, bool definitive)> getLatestReleaseAsync()
private static async System.Threading.Tasks.Task<GitHubReleaseResult?> getLatestReleaseAsync(bool includePreRelease)
{
const string ownerAccount = "rmcrackan";
const string repoName = "Libation";
var gitHubClient = new Octokit.GitHubClient(new Octokit.ProductHeaderValue(repoName));
//https://docs.github.com/en/rest/releases/releases?apiVersion=2022-11-28#get-the-latest-release
var latestRelease = await gitHubClient.Repository.Release.GetLatest(ownerAccount, repoName);
Octokit.Release? latestRelease;
if (includePreRelease)
{
var options = new Octokit.ApiOptions
{
PageCount = 1,
PageSize = 1,
StartPage = 1,
};
var releases = await gitHubClient.Repository.Release.GetAll(ownerAccount, repoName, options);
latestRelease = releases[0];
}
else
{
//https://docs.github.com/en/rest/releases/releases?apiVersion=2022-11-28#get-the-latest-release
latestRelease = await gitHubClient.Repository.Release.GetLatest(ownerAccount, repoName);
}
//Ensure that latest release is greater than the current version
var latestVersionString = latestRelease.TagName.Trim('v');
if (!Version.TryParse(latestVersionString, out var releaseVersion) || releaseVersion <= BuildVersion)
return (null, null, null, true);
var latestVersionString = latestRelease.TagName.TrimStart('v');
if (!NuGetVersion.TryParse(latestVersionString, out var releaseVersion))
{
Serilog.Log.Logger.Warning("Latest release tag is not a valid version: {TagName}", latestRelease.TagName);
return null;
}
if (latestRelease.Prerelease != releaseVersion.IsPrerelease)
{
Serilog.Log.Logger.Warning("Latest release tag indicates pre-release mismatch: {TagName}", latestRelease.TagName);
return null;
}
if (releaseVersion <= BuildVersion)
return new GitHubReleaseResult(releaseVersion);
//Download the release index
var bts = await gitHubClient.Repository.Content.GetRawContent(ownerAccount, repoName, ".releaseindex.json");
@@ -485,7 +548,7 @@ public static class LibationScaffolding
if (string.IsNullOrEmpty(regexPattern))
{
Log.Logger.Warning("Release index has no entry for this platform (ReleaseIdentifier: {ReleaseId}, ReleaseIdString: {ReleaseIdString}). Version check inconclusive.", ReleaseIdentifier, releaseIdString);
return (null, null, null, false);
return new GitHubReleaseResult(releaseVersion, latestRelease);
}
var regex = new System.Text.RegularExpressions.Regex(regexPattern, System.Text.RegularExpressions.RegexOptions.IgnoreCase);
@@ -494,7 +557,7 @@ public static class LibationScaffolding
if (zip is not null && !string.IsNullOrEmpty(releaseIdString))
Log.Logger.Information("Update asset matched using {ReleaseIdString}: {AssetName}", releaseIdString, zip.Name);
return (releaseVersion, latestRelease, zip, true);
return new GitHubReleaseResult(releaseVersion, latestRelease, zip);
}
}

View File

@@ -1,3 +1,4 @@
using NuGet.Versioning;
using System;
using System.Text.RegularExpressions;
@@ -19,15 +20,17 @@ public partial record UpgradeProperties
public string ZipUrl { get; }
public string HtmlUrl { get; }
public string ZipName { get; }
public Version LatestRelease { get; }
public NuGetVersion LatestRelease { get; }
public string Notes { get; }
public bool IsPreRelease { get; }
public UpgradeProperties(string zipUrl, string htmlUrl, string zipName, Version latestRelease, string notes)
public UpgradeProperties(string zipUrl, string htmlUrl, string zipName, NuGetVersion latestRelease, string notes, bool isPrerelease)
{
ZipName = zipName;
HtmlUrl = htmlUrl;
ZipUrl = zipUrl;
LatestRelease = latestRelease;
IsPreRelease = isPrerelease;
var text = NoAppBlockRegex().Replace(notes, "");
text = LinkStripRegex().Replace(text, "$1");

View File

@@ -7,6 +7,7 @@ using DtoImporterService;
using FileManager;
using LibationFileManager;
using Newtonsoft.Json.Linq;
using NuGet.Versioning;
using Serilog;
using System;
using System.Collections.Generic;
@@ -621,7 +622,7 @@ public static class LibraryCommands
udi.UpdateRating(rating.OverallRating, rating.PerformanceRating, rating.StoryRating);
});
public static async Task<int> UpdateBookStatusAsync(this LibraryBook lb, LiberatedStatus bookStatus, Version? libationVersion, AudioFormat? audioFormat, string audioVersion)
public static async Task<int> UpdateBookStatusAsync(this LibraryBook lb, LiberatedStatus bookStatus, NuGetVersion? libationVersion, AudioFormat? audioFormat, string audioVersion)
=> await lb.UpdateUserDefinedItemAsync(udi => { udi.BookStatus = bookStatus; udi.SetLastDownloaded(libationVersion, audioFormat, audioVersion); });
public static async Task<int> UpdateBookStatusAsync(this LibraryBook libraryBook, LiberatedStatus bookStatus)

View File

@@ -1,5 +1,6 @@
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
using NuGet.Versioning;
using System;
namespace DataLayer.Configurations;
@@ -48,7 +49,7 @@ internal class BookConfig : IEntityTypeConfiguration<Book>
b_udi.Property(udi => udi.LastDownloaded);
b_udi
.Property(udi => udi.LastDownloadedVersion)
.HasConversion(ver => ver == null ? null : ver.ToString(), str => str == null ? null : Version.Parse(str));
.HasConversion(ver => ver == null ? null : ver.ToString(), str => str == null ? null : NuGetVersion.Parse(str));
b_udi
.Property(udi => udi.LastDownloadedFormat)
.HasConversion(af => af == null ? 0 : af.Serialize(), str => AudioFormat.Deserialize(str));

View File

@@ -23,6 +23,7 @@
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="NuGet.Versioning" Version="8.0.0" />
</ItemGroup>
<ItemGroup>

View File

@@ -1,4 +1,5 @@
using Dinah.Core;
using NuGet.Versioning;
using System;
using System.Collections.Generic;
using System.Linq;
@@ -31,7 +32,7 @@ public partial class UserDefinedItem
/// <summary>
/// Version of Libation used the last time the audio file was downloaded.
/// </summary>
public Version? LastDownloadedVersion { get; private set; }
public NuGetVersion? LastDownloadedVersion { get; private set; }
/// <summary>
/// Audio format of the last downloaded audio file.
/// </summary>
@@ -41,7 +42,7 @@ public partial class UserDefinedItem
/// </summary>
public string? LastDownloadedFileVersion { get; private set; }
public void SetLastDownloaded(Version? libationVersion, AudioFormat? audioFormat, string? audioVersion)
public void SetLastDownloaded(NuGetVersion? libationVersion, AudioFormat? audioFormat, string? audioVersion)
{
if (LastDownloadedVersion != libationVersion)
{

View File

@@ -1,4 +1,5 @@
using System;
using NuGet.Versioning;
using System;
using System.Linq;
using System.Reflection;
using System.Text;
@@ -57,9 +58,9 @@ public class MockLibraryBook : LibraryBook
return this;
}
public MockLibraryBook WithLastDownloaded(Version? lastVersion = null, AudioFormat? format = null, string audioVersion = "1")
public MockLibraryBook WithLastDownloaded(NuGetVersion? lastVersion = null, AudioFormat? format = null, string audioVersion = "1")
{
lastVersion ??= new Version(10, 0, 0, 0);
lastVersion ??= new NuGetVersion(10, 0, 0, 0);
format ??= AudioFormat.Default;
Book.UserDefinedItem.SetLastDownloaded(lastVersion, format, audioVersion);
return this;
@@ -93,7 +94,7 @@ public class MockLibraryBook : LibraryBook
LiberatedStatus bookStatus = LiberatedStatus.Liberated,
LiberatedStatus? pdfStatus = null,
AudioFormat? lastDlFormat = null,
Version? lastDlVersion = null)
NuGetVersion? lastDlVersion = null)
{
var book = new Book(
new AudibleProductId(CalculateAsin(title + subtitle)),
@@ -109,7 +110,7 @@ public class MockLibraryBook : LibraryBook
lastDlFormat ??= new AudioFormat(Codec.AAC_LC, 128, 44100, 2);
// Three fields, like a real Libation version: Extensions.ToVersionString formats to at least three,
// so a two-field default throws as soon as anything renders a naming template for a mock book.
lastDlVersion ??= new Version(13, 0, 0);
lastDlVersion ??= new NuGetVersion(13, 0, 0);
book.UserDefinedItem.SetLastDownloaded(lastDlVersion, lastDlFormat, "1");
book.UserDefinedItem.PdfStatus = pdfStatus;
book.UserDefinedItem.BookStatus = bookStatus;

View File

@@ -2,7 +2,7 @@
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d" d:DesignWidth="700" d:DesignHeight="600"
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="900"
xmlns:controls="clr-namespace:LibationAvalonia.Controls"
xmlns:vm="clr-namespace:LibationAvalonia.ViewModels.Settings"
x:DataType="vm:ImportantSettingsVM"
@@ -102,11 +102,23 @@
TextWrapping="Wrap"
Text="{Binding DeviceRegistrationReLoginNote}" />
<CheckBox
IsChecked="{Binding CheckForUpgradesAtStartup, Mode=TwoWay}"
ToolTip.Tip="{Binding CheckForUpgradesAtStartupTip}">
<TextBlock Text="{Binding CheckForUpgradesAtStartupText}" />
</CheckBox>
<StackPanel Orientation="Horizontal" >
<CheckBox
Margin="0,0,10,0"
Name="CheckForUpgradesAtStartupCheckBox"
IsChecked="{Binding CheckForUpgradesAtStartup, Mode=TwoWay}"
ToolTip.Tip="{Binding CheckForUpgradesAtStartupTip}">
<TextBlock Text="{Binding CheckForUpgradesAtStartupText}" />
</CheckBox>
<CheckBox
IsEnabled="{Binding #CheckForUpgradesAtStartupCheckBox.IsChecked}"
IsChecked="{Binding CheckForPreRelease, Mode=TwoWay}"
ToolTip.Tip="{Binding CheckForPreReleaseTip}">
<TextBlock Text="{Binding CheckForPreReleaseText}" />
</CheckBox>
</StackPanel>
</StackPanel>
<controls:GroupBox

View File

@@ -1,9 +1,10 @@
using LibationAvalonia.Controls;
using AppScaffolding;
using LibationAvalonia.Controls;
using LibationAvalonia.ViewModels;
using AppScaffolding;
using LibationFileManager;
using LibationUiBase;
using LibationUiBase.Forms;
using NuGet.Versioning;
using ReactiveUI;
using System;
using System.Collections.Generic;
@@ -30,7 +31,7 @@ public partial class AboutDialog : DialogWindow
upgrader.DownloadCompleted += async (_, _) => await Avalonia.Threading.Dispatcher.UIThread.InvokeAsync(() => mainWindow?.ViewModel?.DownloadProgress = null);
_viewModel.CanCheckForUpgrade = false;
Version? latestVersion = null;
NuGetVersion? latestVersion = null;
var result = await upgrader.CheckForUpgradeAsync(OnUpgradeAvailable);
_viewModel.CanCheckForUpgrade = true;

View File

@@ -8,7 +8,9 @@ namespace LibationAvalonia.Dialogs;
public partial class UpgradeNotificationDialog : DialogWindow
{
private const string UpdateMessage = "There is a new version available. Would you like to update?\r\n\r\nAfter you close Libation, the upgrade will start automatically.";
private static string GetReleaseMessage(bool preRelease)
=> string.Format(UpdateMessage, preRelease ? "pre-release" : "release");
private const string UpdateMessage = "There is a new {0} available. Would you like to update?\r\n\r\nAfter you close Libation, the upgrade will start automatically.";
public string? TopMessage { get; }
public string? DownloadLinkText { get; }
public string? ReleaseNotes { get; }
@@ -19,7 +21,7 @@ public partial class UpgradeNotificationDialog : DialogWindow
{
if (Design.IsDesignMode)
{
TopMessage = UpdateMessage;
TopMessage = GetReleaseMessage(false);
Title = "Libation version 8.7.0 is now available.";
DownloadLinkText = "\r\nLibation.12.7.0-macOS-chardonnay-arm64.tgz ";
ReleaseNotes = "New features:\r\n\r\n* 'Remove' now removes forever. Removed books won't be re-added on next scan\r\n* #406 : Right Click Menu for Stop-Light Icon\r\n* #398 : Grid, right-click, copy\r\n* Add option for user to choose custom temp folder\r\n* Build Docker image\r\n\r\nEnhancements\r\n\r\n* Illegal Char Replace dialog in Chardonnay\r\n* Filename character replacement allows replacing any char, not just illegal\r\n* #352 : Better error messages for license denial\r\n* Improve 'cancel download'\r\n\r\nThanks to @Mbucari (u/MSWMan), @pixil98 (u/pixil)\r\n\r\nLibation is a free, open source audible library manager for Windows. Decrypt, backup, organize, and search your audible library\r\n\r\nI intend to keep Libation free and open source, but if you want to leave a tip, who am I to argue?";
@@ -38,7 +40,7 @@ public partial class UpgradeNotificationDialog : DialogWindow
PackageUrl = upgradeProperties.ZipUrl;
DownloadLinkText = upgradeProperties.ZipName;
ReleaseNotes = upgradeProperties.Notes;
TopMessage = canUpgrade ? UpdateMessage : upgradeUnavailableReason ?? "";
TopMessage = canUpgrade ? GetReleaseMessage(upgradeProperties.IsPreRelease) : upgradeUnavailableReason ?? "";
OkText = canUpgrade ? "Yes" : "OK";
DataContext = this;
}

View File

@@ -1,6 +1,7 @@
using AudibleApi;
using AudibleApi.Authorization;
using AudibleUtilities;
using Avalonia.Controls;
using Dinah.Core;
using FileManager;
using LibationFileManager;
@@ -38,6 +39,7 @@ public class ImportantSettingsVM : ViewModelBase
UseWebView = config.UseWebView;
SelectedDeviceRegistration = DeviceRegistrationSettingsUi.Display(config.DeviceRegistrationKind);
CheckForUpgradesAtStartup = config.CheckForUpgradesAtStartup;
CheckForPreRelease = config.CheckForPreRelease;
LoggingLevel = config.LogLevel;
GridScaleFactor = scaleFactorToLinearRange(config.GridScaleFactor);
GridFontScaleFactor = scaleFactorToLinearRange(config.GridFontScaleFactor);
@@ -62,7 +64,8 @@ public class ImportantSettingsVM : ViewModelBase
ExportButtonEnabled = true;
}
RefreshTokenStorageUiState();
if (!Design.IsDesignMode)
RefreshTokenStorageUiState();
ConvertExistingTokensCommand = ReactiveCommand.CreateFromTask(ConvertExistingTokensAsync);
}
@@ -82,6 +85,7 @@ public class ImportantSettingsVM : ViewModelBase
config.UseWebView = UseWebView;
config.DeviceRegistrationKind = SelectedDeviceRegistration.Value;
config.CheckForUpgradesAtStartup = CheckForUpgradesAtStartup;
config.CheckForPreRelease = CheckForPreRelease;
config.LogLevel = LoggingLevel;
config.TokenStorageMethod = SelectedTokenStorageMethod;
initialTokenStorageMethod = SelectedTokenStorageMethod;
@@ -156,6 +160,8 @@ public class ImportantSettingsVM : ViewModelBase
public string UseWebViewSnapMessage { get; } = Configuration.IsRunningUnderSnap ? "Disabled when running in Linux Snap (avoids login crash). Use external browser instead." : "";
public string CheckForUpgradesAtStartupText { get; } = Configuration.GetDescription(nameof(Configuration.CheckForUpgradesAtStartup));
public string CheckForUpgradesAtStartupTip { get; } = Configuration.GetHelpText(nameof(Configuration.CheckForUpgradesAtStartup));
public string CheckForPreReleaseText { get; } = Configuration.GetDescription(nameof(Configuration.CheckForPreRelease));
public string CheckForPreReleaseTip { get; } = Configuration.GetHelpText(nameof(Configuration.CheckForPreRelease));
public Serilog.Events.LogEventLevel[] LoggingLevels { get; } = Enum.GetValues<Serilog.Events.LogEventLevel>();
public string GridScaleFactorText { get; } = Configuration.GetDescription(nameof(Configuration.GridScaleFactor));
public string GridFontScaleFactorText { get; } = Configuration.GetDescription(nameof(Configuration.GridFontScaleFactor));
@@ -183,6 +189,7 @@ public class ImportantSettingsVM : ViewModelBase
public bool UseWebView { get; set; }
public EnumDisplay<DeviceRegistrationKind> SelectedDeviceRegistration { get; set; }
public bool CheckForUpgradesAtStartup { get; set; }
public bool CheckForPreRelease { get; set; }
public Serilog.Events.LogEventLevel LoggingLevel { get; set; }
public bool EncryptTokens

View File

@@ -24,7 +24,7 @@ internal class VersionOptions : OptionsBase
var origColor = Console.ForegroundColor;
try
{
var result = LibationScaffolding.GetLatestRelease();
var result = LibationScaffolding.GetLatestRelease(Configuration.Instance.CheckForPreRelease);
switch (result.Outcome)
{

View File

@@ -1,4 +1,6 @@
using NuGet.Versioning;
using System;
using System.Linq;
namespace LibationFileManager;
@@ -13,10 +15,10 @@ public enum OS
public static class Extensions
{
public static string ToVersionString(this Version? version)
public static string ToVersionString(this NuGetVersion? version)
=> version is null ? "[unknown]"
: version.Revision > 1 ? version.ToString(4)
: version.ToString(3);
: version.IsLegacyVersion && version.Revision > 1 && !version.ReleaseLabels.Any() ? version.ToString("x.y.z.r", VersionFormatter.Instance)
: version.ToString();
}
public partial class Configuration
@@ -38,8 +40,8 @@ public partial class Configuration
|| string.Equals(getEnv("XDG_SESSION_TYPE"), "wayland", StringComparison.OrdinalIgnoreCase);
}
public static Version? LibationVersion { get; private set; }
public static void SetLibationVersion(Version? version) => LibationVersion = version;
public static NuGetVersion? LibationVersion { get; private set; }
public static void SetLibationVersion(NuGetVersion? version) => LibationVersion = version;
public static OS OS { get; }
= IsLinux ? OS.Linux

View File

@@ -180,6 +180,11 @@ public partial class Configuration
Settings > About has a "Check for Upgrade" button
that works either way.
""" },
{nameof(CheckForPreRelease), """
When enabled, Libation checks for pre-release
versions including alphas, betas, and
release candidates.
""" },
{nameof(DeviceRegistrationKind), """
Which virtual device Libation registers with Amazon
when you sign in.

View File

@@ -121,6 +121,9 @@ public partial class Configuration
[Description("Check for new Libation versions at startup")]
public bool CheckForUpgradesAtStartup { get => GetNonString(defaultValue: true); set => SetNonString(value); }
[Description("Include pre-releases when checking for Libation updates")]
public bool CheckForPreRelease { get => GetNonString(defaultValue: false); set => SetNonString(value); }
[Description("Location for book storage. Includes destination of newly liberated books")]
public LongPath? Books
{

View File

@@ -1,4 +1,5 @@
using System;
using NuGet.Versioning;
using System;
using System.Diagnostics;
using System.Threading.Tasks;
@@ -11,7 +12,7 @@ public interface IInteropFunctions
void DeleteFolderIcon(string directory);
Process? RunAsRoot(string exe, string args);
/// <summary>Waits for the privileged installer where possible and throws if it fails.</summary>
Task InstallUpgradeAsync(string upgradeBundle, Version targetVersion);
Task InstallUpgradeAsync(string upgradeBundle, NuGetVersion targetVersion);
/// <summary>Best-effort sync of installer metadata (e.g. Windows Add/Remove Programs). Never throws.</summary>
void TrySyncInstallMetadata();
bool CanUpgrade { get; }

View File

@@ -1,3 +1,4 @@
using NuGet.Versioning;
using System;
using System.Collections.Generic;
using System.IO;
@@ -126,7 +127,7 @@ public static class InstallUpgradeManager
/// Snapshot critical install files and record expected post-upgrade hashes from the upgrade zip.
/// Call immediately before launching ZipExtractor.
/// </summary>
public static void PrepareForUpgrade(string installDirectory, string upgradeBundlePath, Version targetVersion)
public static void PrepareForUpgrade(string installDirectory, string upgradeBundlePath, NuGetVersion targetVersion)
{
ArgumentException.ThrowIfNullOrWhiteSpace(installDirectory);
ArgumentException.ThrowIfNullOrWhiteSpace(upgradeBundlePath);

View File

@@ -6,9 +6,10 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="AudibleApi" Version="14.1.2" />
<PackageReference Include="AudibleApi" Version="14.1.3" />
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="10.0.14" />
<PackageReference Include="NameParserSharp" Version="1.5.0" />
<PackageReference Include="NuGet.Versioning" Version="8.0.0" />
<PackageReference Include="Serilog.Exceptions" Version="8.4.0" />
</ItemGroup>

View File

@@ -1,4 +1,5 @@
using System;
using NuGet.Versioning;
using System;
using System.Diagnostics;
using System.Threading.Tasks;
@@ -16,6 +17,6 @@ public class NullInteropFunctions : IInteropFunctions
public bool CanUpgrade => throw new PlatformNotSupportedException();
public string ReleaseIdString => throw new PlatformNotSupportedException();
public Process RunAsRoot(string exe, string args) => throw new PlatformNotSupportedException();
public Task InstallUpgradeAsync(string updateBundle, Version targetVersion) => throw new PlatformNotSupportedException();
public Task InstallUpgradeAsync(string updateBundle, NuGetVersion targetVersion) => throw new PlatformNotSupportedException();
public void TrySyncInstallMetadata() { }
}

View File

@@ -1,5 +1,6 @@
using DataLayer;
using LibationFileManager;
using NuGet.Versioning;
using System;
namespace LibationUiBase.GridView;
@@ -9,7 +10,7 @@ public class LastDownloadStatus : IComparable
public bool IsValid => LastDownloadedVersion is not null && LastDownloaded.HasValue;
public AudioFormat? LastDownloadedFormat { get; }
public string? LastDownloadedFileVersion { get; }
public Version? LastDownloadedVersion { get; }
public NuGetVersion? LastDownloadedVersion { get; }
public DateTime? LastDownloaded { get; }
public string ToolTipText => IsValid ? $"Double click to open v{LastDownloadedVersion!.ToVersionString()} release notes" : "";

View File

@@ -50,7 +50,7 @@ public class Upgrader : UpgraderBase
{
try
{
return await Task.Run(LibationScaffolding.GetLatestRelease);
return await Task.Run(() => LibationScaffolding.GetLatestRelease(Configuration.Instance.CheckForPreRelease));
}
catch (Exception ex)
{
@@ -159,7 +159,8 @@ public class MockUpgrader : UpgraderBase
"",
Path.GetFileName(MockUpgradeBundle) ?? "",
LibationScaffolding.BuildVersion ?? new(1, 0, 0, 0),
"<RELEASE NOTES>")));
"<RELEASE NOTES>",
isPrerelease: false)));
}
protected override async Task<string?> DownloadUpgradeAsync(UpgradeProperties upgradeProperties)

View File

@@ -1,6 +1,7 @@
using AppScaffolding;
using LibationFileManager;
using LibationUiBase;
using NuGet.Versioning;
using System;
using System.Linq;
using System.Threading.Tasks;
@@ -57,7 +58,7 @@ public partial class AboutDialog : Form
upgrader.DownloadCompleted += (_, _) => form1?.Invoke(() => form1.upgradeLbl.Visible = form1.upgradePb.Visible = false);
checkForUpgradeBtn.Enabled = false;
Version? latestVersion = null;
NuGetVersion? latestVersion = null;
var result = await upgrader.CheckForUpgradeAsync(OnUpgradeAvailable);
checkForUpgradeBtn.Enabled = true;

View File

@@ -35,17 +35,17 @@ namespace LibationWinForms.Dialogs
importEpisodesCb = new System.Windows.Forms.CheckBox();
downloadEpisodesCb = new System.Windows.Forms.CheckBox();
badBookGb = new System.Windows.Forms.GroupBox();
dailyDownloadLimitGb = new System.Windows.Forms.GroupBox();
dailyDownloadLimitDescLbl = new System.Windows.Forms.Label();
dailyDownloadLimitScopeCb = new System.Windows.Forms.ComboBox();
dailyDownloadLimitQtyLbl = new System.Windows.Forms.Label();
dailyDownloadLimitQtyNud = new System.Windows.Forms.NumericUpDown();
dailyDownloadLimitUnitCb = new System.Windows.Forms.ComboBox();
dailyDownloadLimitApproxLbl = new System.Windows.Forms.Label();
badBookIgnoreRb = new System.Windows.Forms.RadioButton();
badBookRetryRb = new System.Windows.Forms.RadioButton();
badBookAbortRb = new System.Windows.Forms.RadioButton();
badBookAskRb = new System.Windows.Forms.RadioButton();
dailyDownloadLimitGb = new System.Windows.Forms.GroupBox();
dailyDownloadLimitApproxLbl = new System.Windows.Forms.Label();
dailyDownloadLimitUnitCb = new System.Windows.Forms.ComboBox();
dailyDownloadLimitQtyNud = new System.Windows.Forms.NumericUpDown();
dailyDownloadLimitQtyLbl = new System.Windows.Forms.Label();
dailyDownloadLimitScopeCb = new System.Windows.Forms.ComboBox();
dailyDownloadLimitDescLbl = new System.Windows.Forms.Label();
stripAudibleBrandingCbox = new System.Windows.Forms.CheckBox();
splitFilesByChapterCbox = new System.Windows.Forms.CheckBox();
allowLibationFixupCbox = new System.Windows.Forms.CheckBox();
@@ -55,21 +55,8 @@ namespace LibationWinForms.Dialogs
loggingLevelLbl = new System.Windows.Forms.Label();
loggingLevelCb = new System.Windows.Forms.ComboBox();
tabControl = new System.Windows.Forms.TabControl();
tab5Audiobookshelf = new System.Windows.Forms.TabPage();
absEnabledCb = new System.Windows.Forms.CheckBox();
absIncludePdfsCb = new System.Windows.Forms.CheckBox();
absPlaintextWarningLbl = new System.Windows.Forms.Label();
absUrlLbl = new System.Windows.Forms.Label();
absUrlTb = new System.Windows.Forms.TextBox();
absTokenLbl = new System.Windows.Forms.Label();
absTokenTb = new System.Windows.Forms.TextBox();
absConnectBtn = new System.Windows.Forms.Button();
absStatusLbl = new System.Windows.Forms.Label();
absLibraryLbl = new System.Windows.Forms.Label();
absLibraryCb = new System.Windows.Forms.ComboBox();
absFolderLbl = new System.Windows.Forms.Label();
absFolderCb = new System.Windows.Forms.ComboBox();
tab1ImportantSettings = new System.Windows.Forms.TabPage();
preReleaseCbox = new System.Windows.Forms.CheckBox();
checkForUpgradesCbox = new System.Windows.Forms.CheckBox();
themeLbl = new System.Windows.Forms.Label();
themeCb = new System.Windows.Forms.ComboBox();
@@ -81,11 +68,11 @@ namespace LibationWinForms.Dialogs
gridFontScaleFactorLbl = new System.Windows.Forms.Label();
gridFontScaleFactorTbar = new System.Windows.Forms.TrackBar();
tokenStorageGb = new System.Windows.Forms.GroupBox();
encryptTokensCbox = new System.Windows.Forms.CheckBox();
plaintextTokenWarningLbl = new System.Windows.Forms.Label();
osSecretStoreUnavailableLbl = new System.Windows.Forms.Label();
exportMasterKeyBtn = new System.Windows.Forms.Button();
updateExistingTokensBtn = new System.Windows.Forms.Button();
exportMasterKeyBtn = new System.Windows.Forms.Button();
osSecretStoreUnavailableLbl = new System.Windows.Forms.Label();
plaintextTokenWarningLbl = new System.Windows.Forms.Label();
encryptTokensCbox = new System.Windows.Forms.CheckBox();
booksGb = new System.Windows.Forms.GroupBox();
booksSelectControl = new DirectoryOrCustomSelectControl();
lastWriteTimeCb = new System.Windows.Forms.ComboBox();
@@ -172,6 +159,20 @@ namespace LibationWinForms.Dialogs
retainAaxFileCbox = new System.Windows.Forms.CheckBox();
downloadCoverArtCbox = new System.Windows.Forms.CheckBox();
createCueSheetCbox = new System.Windows.Forms.CheckBox();
tab5Audiobookshelf = new System.Windows.Forms.TabPage();
absEnabledCb = new System.Windows.Forms.CheckBox();
absIncludePdfsCb = new System.Windows.Forms.CheckBox();
absPlaintextWarningLbl = new System.Windows.Forms.Label();
absUrlLbl = new System.Windows.Forms.Label();
absUrlTb = new System.Windows.Forms.TextBox();
absTokenLbl = new System.Windows.Forms.Label();
absTokenTb = new System.Windows.Forms.TextBox();
absConnectBtn = new System.Windows.Forms.Button();
absStatusLbl = new System.Windows.Forms.Label();
absLibraryLbl = new System.Windows.Forms.Label();
absLibraryCb = new System.Windows.Forms.ComboBox();
absFolderLbl = new System.Windows.Forms.Label();
absFolderCb = new System.Windows.Forms.ComboBox();
badBookGb.SuspendLayout();
dailyDownloadLimitGb.SuspendLayout();
((System.ComponentModel.ISupportInitialize)dailyDownloadLimitQtyNud).BeginInit();
@@ -187,7 +188,6 @@ namespace LibationWinForms.Dialogs
inProgressFilesGb.SuspendLayout();
customFileNamingGb.SuspendLayout();
tab4AudioFileOptions.SuspendLayout();
tab5Audiobookshelf.SuspendLayout();
audiobookFixupsGb.SuspendLayout();
((System.ComponentModel.ISupportInitialize)minFileDurationNud).BeginInit();
chapterTitleTemplateGb.SuspendLayout();
@@ -197,6 +197,7 @@ namespace LibationWinForms.Dialogs
lameQualityGb.SuspendLayout();
((System.ComponentModel.ISupportInitialize)lameVBRQualityTb).BeginInit();
groupBox2.SuspendLayout();
tab5Audiobookshelf.SuspendLayout();
SuspendLayout();
//
// booksLocationDescLbl
@@ -273,7 +274,7 @@ namespace LibationWinForms.Dialogs
badBookGb.Controls.Add(badBookAskRb);
badBookGb.Location = new System.Drawing.Point(7, 122);
badBookGb.Name = "badBookGb";
badBookGb.Size = new System.Drawing.Size(841, 76);
badBookGb.Size = new System.Drawing.Size(807, 76);
badBookGb.TabIndex = 13;
badBookGb.TabStop = false;
badBookGb.Text = "[bad book desc]";
@@ -322,6 +323,77 @@ namespace LibationWinForms.Dialogs
badBookAskRb.Text = "[ask desc]";
badBookAskRb.UseVisualStyleBackColor = true;
//
// dailyDownloadLimitGb
//
dailyDownloadLimitGb.Anchor = System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right;
dailyDownloadLimitGb.Controls.Add(dailyDownloadLimitApproxLbl);
dailyDownloadLimitGb.Controls.Add(dailyDownloadLimitUnitCb);
dailyDownloadLimitGb.Controls.Add(dailyDownloadLimitQtyNud);
dailyDownloadLimitGb.Controls.Add(dailyDownloadLimitQtyLbl);
dailyDownloadLimitGb.Controls.Add(dailyDownloadLimitScopeCb);
dailyDownloadLimitGb.Controls.Add(dailyDownloadLimitDescLbl);
dailyDownloadLimitGb.Location = new System.Drawing.Point(7, 6);
dailyDownloadLimitGb.Name = "dailyDownloadLimitGb";
dailyDownloadLimitGb.Size = new System.Drawing.Size(808, 110);
dailyDownloadLimitGb.TabIndex = 23;
dailyDownloadLimitGb.TabStop = false;
dailyDownloadLimitGb.Text = "[daily download limit desc]";
//
// dailyDownloadLimitApproxLbl
//
dailyDownloadLimitApproxLbl.Location = new System.Drawing.Point(485, 53);
dailyDownloadLimitApproxLbl.Name = "dailyDownloadLimitApproxLbl";
dailyDownloadLimitApproxLbl.Size = new System.Drawing.Size(350, 45);
dailyDownloadLimitApproxLbl.TabIndex = 6;
dailyDownloadLimitApproxLbl.Text = "[mb/gb approximate note]";
//
// dailyDownloadLimitUnitCb
//
dailyDownloadLimitUnitCb.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
dailyDownloadLimitUnitCb.FormattingEnabled = true;
dailyDownloadLimitUnitCb.Location = new System.Drawing.Point(383, 57);
dailyDownloadLimitUnitCb.Name = "dailyDownloadLimitUnitCb";
dailyDownloadLimitUnitCb.Size = new System.Drawing.Size(90, 23);
dailyDownloadLimitUnitCb.TabIndex = 5;
dailyDownloadLimitUnitCb.SelectedIndexChanged += dailyDownloadLimitUnitCb_SelectedIndexChanged;
//
// dailyDownloadLimitQtyNud
//
dailyDownloadLimitQtyNud.Location = new System.Drawing.Point(264, 57);
dailyDownloadLimitQtyNud.Maximum = new decimal(new int[] { int.MaxValue, 0, 0, 0 });
dailyDownloadLimitQtyNud.Minimum = new decimal(new int[] { 1, 0, 0, 0 });
dailyDownloadLimitQtyNud.Name = "dailyDownloadLimitQtyNud";
dailyDownloadLimitQtyNud.Size = new System.Drawing.Size(110, 23);
dailyDownloadLimitQtyNud.TabIndex = 4;
dailyDownloadLimitQtyNud.Value = new decimal(new int[] { 50, 0, 0, 0 });
//
// dailyDownloadLimitQtyLbl
//
dailyDownloadLimitQtyLbl.AutoSize = true;
dailyDownloadLimitQtyLbl.Location = new System.Drawing.Point(220, 61);
dailyDownloadLimitQtyLbl.Name = "dailyDownloadLimitQtyLbl";
dailyDownloadLimitQtyLbl.Size = new System.Drawing.Size(32, 15);
dailyDownloadLimitQtyLbl.TabIndex = 3;
dailyDownloadLimitQtyLbl.Text = "[qty]";
//
// dailyDownloadLimitScopeCb
//
dailyDownloadLimitScopeCb.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
dailyDownloadLimitScopeCb.FormattingEnabled = true;
dailyDownloadLimitScopeCb.Location = new System.Drawing.Point(7, 57);
dailyDownloadLimitScopeCb.Name = "dailyDownloadLimitScopeCb";
dailyDownloadLimitScopeCb.Size = new System.Drawing.Size(200, 23);
dailyDownloadLimitScopeCb.TabIndex = 2;
dailyDownloadLimitScopeCb.SelectedIndexChanged += dailyDownloadLimitScopeCb_SelectedIndexChanged;
//
// dailyDownloadLimitDescLbl
//
dailyDownloadLimitDescLbl.Location = new System.Drawing.Point(7, 19);
dailyDownloadLimitDescLbl.Name = "dailyDownloadLimitDescLbl";
dailyDownloadLimitDescLbl.Size = new System.Drawing.Size(828, 32);
dailyDownloadLimitDescLbl.TabIndex = 1;
dailyDownloadLimitDescLbl.Text = "[daily download limit long desc]";
//
// stripAudibleBrandingCbox
//
stripAudibleBrandingCbox.AutoSize = true;
@@ -409,16 +481,6 @@ namespace LibationWinForms.Dialogs
loggingLevelCb.Size = new System.Drawing.Size(129, 23);
loggingLevelCb.TabIndex = 4;
//
// checkForUpgradesCbox
//
checkForUpgradesCbox.AutoSize = true;
checkForUpgradesCbox.Location = new System.Drawing.Point(6, 569);
checkForUpgradesCbox.Name = "checkForUpgradesCbox";
checkForUpgradesCbox.Size = new System.Drawing.Size(300, 19);
checkForUpgradesCbox.TabIndex = 13;
checkForUpgradesCbox.Text = "[Check for upgrades at startup]";
checkForUpgradesCbox.UseVisualStyleBackColor = true;
//
// tabControl
//
tabControl.Anchor = System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right;
@@ -437,6 +499,7 @@ namespace LibationWinForms.Dialogs
//
tab1ImportantSettings.AutoScroll = true;
tab1ImportantSettings.BackColor = System.Drawing.SystemColors.Window;
tab1ImportantSettings.Controls.Add(preReleaseCbox);
tab1ImportantSettings.Controls.Add(checkForUpgradesCbox);
tab1ImportantSettings.Controls.Add(themeLbl);
tab1ImportantSettings.Controls.Add(themeCb);
@@ -454,6 +517,27 @@ namespace LibationWinForms.Dialogs
tab1ImportantSettings.TabIndex = 0;
tab1ImportantSettings.Text = "Important settings";
//
// preReleaseCbox
//
preReleaseCbox.AutoSize = true;
preReleaseCbox.Location = new System.Drawing.Point(411, 569);
preReleaseCbox.Name = "preReleaseCbox";
preReleaseCbox.Size = new System.Drawing.Size(198, 19);
preReleaseCbox.TabIndex = 14;
preReleaseCbox.Text = "[Check for pre-release upgrades]";
preReleaseCbox.UseVisualStyleBackColor = true;
//
// checkForUpgradesCbox
//
checkForUpgradesCbox.AutoSize = true;
checkForUpgradesCbox.Location = new System.Drawing.Point(6, 569);
checkForUpgradesCbox.Name = "checkForUpgradesCbox";
checkForUpgradesCbox.Size = new System.Drawing.Size(190, 19);
checkForUpgradesCbox.TabIndex = 13;
checkForUpgradesCbox.Text = "[Check for upgrades at startup]";
checkForUpgradesCbox.UseVisualStyleBackColor = true;
checkForUpgradesCbox.CheckedChanged += checkForUpgradesCbox_CheckedChanged;
//
// themeLbl
//
themeLbl.AutoSize = true;
@@ -492,7 +576,7 @@ namespace LibationWinForms.Dialogs
groupBox1.Controls.Add(gridFontScaleFactorTbar);
groupBox1.Location = new System.Drawing.Point(6, 387);
groupBox1.Name = "groupBox1";
groupBox1.Size = new System.Drawing.Size(844, 83);
groupBox1.Size = new System.Drawing.Size(810, 83);
groupBox1.TabIndex = 9;
groupBox1.TabStop = false;
groupBox1.Text = "Display Settings";
@@ -500,7 +584,7 @@ namespace LibationWinForms.Dialogs
// applyDisplaySettingsBtn
//
applyDisplaySettingsBtn.Anchor = System.Windows.Forms.AnchorStyles.Right;
applyDisplaySettingsBtn.Location = new System.Drawing.Point(672, 26);
applyDisplaySettingsBtn.Location = new System.Drawing.Point(638, 26);
applyDisplaySettingsBtn.Name = "applyDisplaySettingsBtn";
applyDisplaySettingsBtn.Size = new System.Drawing.Size(148, 34);
applyDisplaySettingsBtn.TabIndex = 9;
@@ -560,47 +644,26 @@ namespace LibationWinForms.Dialogs
tokenStorageGb.Controls.Add(encryptTokensCbox);
tokenStorageGb.Location = new System.Drawing.Point(6, 277);
tokenStorageGb.Name = "tokenStorageGb";
tokenStorageGb.Size = new System.Drawing.Size(844, 104);
tokenStorageGb.Size = new System.Drawing.Size(810, 104);
tokenStorageGb.TabIndex = 8;
tokenStorageGb.TabStop = false;
tokenStorageGb.Text = "Authentication tokens";
//
// encryptTokensCbox
// updateExistingTokensBtn
//
encryptTokensCbox.AutoSize = true;
encryptTokensCbox.Location = new System.Drawing.Point(8, 22);
encryptTokensCbox.Name = "encryptTokensCbox";
encryptTokensCbox.Size = new System.Drawing.Size(520, 19);
encryptTokensCbox.TabIndex = 0;
encryptTokensCbox.Text = "Store authentication tokens encrypted. Unchecking this option stores tokens in plaintext.";
encryptTokensCbox.UseVisualStyleBackColor = true;
encryptTokensCbox.CheckedChanged += encryptTokensCbox_CheckedChanged;
//
// plaintextTokenWarningLbl
//
plaintextTokenWarningLbl.AutoSize = true;
plaintextTokenWarningLbl.ForeColor = System.Drawing.Color.DarkRed;
plaintextTokenWarningLbl.Location = new System.Drawing.Point(27, 44);
plaintextTokenWarningLbl.Name = "plaintextTokenWarningLbl";
plaintextTokenWarningLbl.Size = new System.Drawing.Size(480, 15);
plaintextTokenWarningLbl.TabIndex = 1;
plaintextTokenWarningLbl.Text = "Authentication tokens will be stored as readable plaintext in AccountsSettings.json.";
//
// osSecretStoreUnavailableLbl
//
osSecretStoreUnavailableLbl.AutoSize = true;
osSecretStoreUnavailableLbl.ForeColor = System.Drawing.Color.DarkRed;
osSecretStoreUnavailableLbl.Location = new System.Drawing.Point(27, 44);
osSecretStoreUnavailableLbl.Name = "osSecretStoreUnavailableLbl";
osSecretStoreUnavailableLbl.Size = new System.Drawing.Size(250, 15);
osSecretStoreUnavailableLbl.TabIndex = 2;
osSecretStoreUnavailableLbl.Text = "[OS secret store unavailable]";
osSecretStoreUnavailableLbl.Visible = false;
updateExistingTokensBtn.Anchor = System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right;
updateExistingTokensBtn.Location = new System.Drawing.Point(594, 68);
updateExistingTokensBtn.Name = "updateExistingTokensBtn";
updateExistingTokensBtn.Size = new System.Drawing.Size(200, 27);
updateExistingTokensBtn.TabIndex = 4;
updateExistingTokensBtn.Text = "Update existing stored tokens";
updateExistingTokensBtn.UseVisualStyleBackColor = true;
updateExistingTokensBtn.Click += updateExistingTokensBtn_Click;
//
// exportMasterKeyBtn
//
exportMasterKeyBtn.Anchor = System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right;
exportMasterKeyBtn.Location = new System.Drawing.Point(422, 68);
exportMasterKeyBtn.Location = new System.Drawing.Point(388, 68);
exportMasterKeyBtn.Name = "exportMasterKeyBtn";
exportMasterKeyBtn.Size = new System.Drawing.Size(200, 27);
exportMasterKeyBtn.TabIndex = 3;
@@ -608,16 +671,37 @@ namespace LibationWinForms.Dialogs
exportMasterKeyBtn.UseVisualStyleBackColor = true;
exportMasterKeyBtn.Click += exportMasterKeyBtn_Click;
//
// updateExistingTokensBtn
// osSecretStoreUnavailableLbl
//
updateExistingTokensBtn.Anchor = System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right;
updateExistingTokensBtn.Location = new System.Drawing.Point(628, 68);
updateExistingTokensBtn.Name = "updateExistingTokensBtn";
updateExistingTokensBtn.Size = new System.Drawing.Size(200, 27);
updateExistingTokensBtn.TabIndex = 4;
updateExistingTokensBtn.Text = "Update existing stored tokens";
updateExistingTokensBtn.UseVisualStyleBackColor = true;
updateExistingTokensBtn.Click += updateExistingTokensBtn_Click;
osSecretStoreUnavailableLbl.AutoSize = true;
osSecretStoreUnavailableLbl.ForeColor = System.Drawing.Color.DarkRed;
osSecretStoreUnavailableLbl.Location = new System.Drawing.Point(27, 44);
osSecretStoreUnavailableLbl.Name = "osSecretStoreUnavailableLbl";
osSecretStoreUnavailableLbl.Size = new System.Drawing.Size(156, 15);
osSecretStoreUnavailableLbl.TabIndex = 2;
osSecretStoreUnavailableLbl.Text = "[OS secret store unavailable]";
osSecretStoreUnavailableLbl.Visible = false;
//
// plaintextTokenWarningLbl
//
plaintextTokenWarningLbl.AutoSize = true;
plaintextTokenWarningLbl.ForeColor = System.Drawing.Color.DarkRed;
plaintextTokenWarningLbl.Location = new System.Drawing.Point(27, 44);
plaintextTokenWarningLbl.Name = "plaintextTokenWarningLbl";
plaintextTokenWarningLbl.Size = new System.Drawing.Size(443, 15);
plaintextTokenWarningLbl.TabIndex = 1;
plaintextTokenWarningLbl.Text = "Authentication tokens will be stored as readable plaintext in AccountsSettings.json.";
//
// encryptTokensCbox
//
encryptTokensCbox.AutoSize = true;
encryptTokensCbox.Location = new System.Drawing.Point(8, 22);
encryptTokensCbox.Name = "encryptTokensCbox";
encryptTokensCbox.Size = new System.Drawing.Size(492, 19);
encryptTokensCbox.TabIndex = 0;
encryptTokensCbox.Text = "Store authentication tokens encrypted. Unchecking this option stores tokens in plaintext.";
encryptTokensCbox.UseVisualStyleBackColor = true;
encryptTokensCbox.CheckedChanged += encryptTokensCbox_CheckedChanged;
//
// booksGb
//
@@ -632,7 +716,7 @@ namespace LibationWinForms.Dialogs
booksGb.Controls.Add(booksLocationDescLbl);
booksGb.Location = new System.Drawing.Point(6, 6);
booksGb.Name = "booksGb";
booksGb.Size = new System.Drawing.Size(844, 265);
booksGb.Size = new System.Drawing.Size(810, 265);
booksGb.TabIndex = 0;
booksGb.TabStop = false;
booksGb.Text = "Books location";
@@ -642,7 +726,7 @@ namespace LibationWinForms.Dialogs
booksSelectControl.Anchor = System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right;
booksSelectControl.Location = new System.Drawing.Point(8, 37);
booksSelectControl.Name = "booksSelectControl";
booksSelectControl.Size = new System.Drawing.Size(830, 80);
booksSelectControl.Size = new System.Drawing.Size(796, 80);
booksSelectControl.TabIndex = 6;
//
// lastWriteTimeCb
@@ -768,7 +852,7 @@ namespace LibationWinForms.Dialogs
useWebViewCb.AutoSize = true;
useWebViewCb.Location = new System.Drawing.Point(6, 56);
useWebViewCb.Name = "useWebViewCb";
useWebViewCb.Size = new System.Drawing.Size(112, 19);
useWebViewCb.Size = new System.Drawing.Size(128, 19);
useWebViewCb.TabIndex = 3;
useWebViewCb.Text = "[use webview desc]";
useWebViewCb.UseVisualStyleBackColor = true;
@@ -778,7 +862,7 @@ namespace LibationWinForms.Dialogs
deviceRegistrationLbl.AutoSize = true;
deviceRegistrationLbl.Location = new System.Drawing.Point(6, 81);
deviceRegistrationLbl.Name = "deviceRegistrationLbl";
deviceRegistrationLbl.Size = new System.Drawing.Size(200, 15);
deviceRegistrationLbl.Size = new System.Drawing.Size(139, 15);
deviceRegistrationLbl.TabIndex = 4;
deviceRegistrationLbl.Text = "[device registration desc]";
//
@@ -791,77 +875,6 @@ namespace LibationWinForms.Dialogs
deviceRegistrationCb.Size = new System.Drawing.Size(520, 23);
deviceRegistrationCb.TabIndex = 5;
//
// dailyDownloadLimitGb
//
dailyDownloadLimitGb.Anchor = System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right;
dailyDownloadLimitGb.Controls.Add(dailyDownloadLimitApproxLbl);
dailyDownloadLimitGb.Controls.Add(dailyDownloadLimitUnitCb);
dailyDownloadLimitGb.Controls.Add(dailyDownloadLimitQtyNud);
dailyDownloadLimitGb.Controls.Add(dailyDownloadLimitQtyLbl);
dailyDownloadLimitGb.Controls.Add(dailyDownloadLimitScopeCb);
dailyDownloadLimitGb.Controls.Add(dailyDownloadLimitDescLbl);
dailyDownloadLimitGb.Location = new System.Drawing.Point(7, 6);
dailyDownloadLimitGb.Name = "dailyDownloadLimitGb";
dailyDownloadLimitGb.Size = new System.Drawing.Size(842, 110);
dailyDownloadLimitGb.TabIndex = 23;
dailyDownloadLimitGb.TabStop = false;
dailyDownloadLimitGb.Text = "[daily download limit desc]";
//
// dailyDownloadLimitDescLbl
//
dailyDownloadLimitDescLbl.Location = new System.Drawing.Point(7, 19);
dailyDownloadLimitDescLbl.Name = "dailyDownloadLimitDescLbl";
dailyDownloadLimitDescLbl.Size = new System.Drawing.Size(828, 32);
dailyDownloadLimitDescLbl.TabIndex = 1;
dailyDownloadLimitDescLbl.Text = "[daily download limit long desc]";
//
// dailyDownloadLimitScopeCb
//
dailyDownloadLimitScopeCb.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
dailyDownloadLimitScopeCb.FormattingEnabled = true;
dailyDownloadLimitScopeCb.Location = new System.Drawing.Point(7, 57);
dailyDownloadLimitScopeCb.Name = "dailyDownloadLimitScopeCb";
dailyDownloadLimitScopeCb.Size = new System.Drawing.Size(200, 23);
dailyDownloadLimitScopeCb.TabIndex = 2;
dailyDownloadLimitScopeCb.SelectedIndexChanged += dailyDownloadLimitScopeCb_SelectedIndexChanged;
//
// dailyDownloadLimitQtyLbl
//
dailyDownloadLimitQtyLbl.AutoSize = true;
dailyDownloadLimitQtyLbl.Location = new System.Drawing.Point(220, 61);
dailyDownloadLimitQtyLbl.Name = "dailyDownloadLimitQtyLbl";
dailyDownloadLimitQtyLbl.Size = new System.Drawing.Size(38, 15);
dailyDownloadLimitQtyLbl.TabIndex = 3;
dailyDownloadLimitQtyLbl.Text = "[qty]";
//
// dailyDownloadLimitQtyNud
//
dailyDownloadLimitQtyNud.Location = new System.Drawing.Point(264, 57);
dailyDownloadLimitQtyNud.Maximum = new decimal(new int[] { int.MaxValue, 0, 0, 0 });
dailyDownloadLimitQtyNud.Minimum = new decimal(new int[] { 1, 0, 0, 0 });
dailyDownloadLimitQtyNud.Name = "dailyDownloadLimitQtyNud";
dailyDownloadLimitQtyNud.Size = new System.Drawing.Size(110, 23);
dailyDownloadLimitQtyNud.TabIndex = 4;
dailyDownloadLimitQtyNud.Value = new decimal(new int[] { 50, 0, 0, 0 });
//
// dailyDownloadLimitUnitCb
//
dailyDownloadLimitUnitCb.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
dailyDownloadLimitUnitCb.FormattingEnabled = true;
dailyDownloadLimitUnitCb.Location = new System.Drawing.Point(383, 57);
dailyDownloadLimitUnitCb.Name = "dailyDownloadLimitUnitCb";
dailyDownloadLimitUnitCb.Size = new System.Drawing.Size(90, 23);
dailyDownloadLimitUnitCb.TabIndex = 5;
dailyDownloadLimitUnitCb.SelectedIndexChanged += dailyDownloadLimitUnitCb_SelectedIndexChanged;
//
// dailyDownloadLimitApproxLbl
//
dailyDownloadLimitApproxLbl.Location = new System.Drawing.Point(485, 53);
dailyDownloadLimitApproxLbl.Name = "dailyDownloadLimitApproxLbl";
dailyDownloadLimitApproxLbl.Size = new System.Drawing.Size(350, 45);
dailyDownloadLimitApproxLbl.TabIndex = 6;
dailyDownloadLimitApproxLbl.Text = "[mb/gb approximate note]";
//
// tab3DownloadDecrypt
//
tab3DownloadDecrypt.AutoScroll = true;
@@ -883,7 +896,7 @@ namespace LibationWinForms.Dialogs
//
saveMetadataToFileCbox.Anchor = System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right;
saveMetadataToFileCbox.AutoSize = true;
saveMetadataToFileCbox.Location = new System.Drawing.Point(481, 551);
saveMetadataToFileCbox.Location = new System.Drawing.Point(447, 551);
saveMetadataToFileCbox.Name = "saveMetadataToFileCbox";
saveMetadataToFileCbox.Size = new System.Drawing.Size(166, 19);
saveMetadataToFileCbox.TabIndex = 22;
@@ -892,7 +905,6 @@ namespace LibationWinForms.Dialogs
//
// useCoverAsFolderIconCb
//
useCoverAsFolderIconCb.Anchor = System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left;
useCoverAsFolderIconCb.AutoSize = true;
useCoverAsFolderIconCb.Location = new System.Drawing.Point(6, 551);
useCoverAsFolderIconCb.Name = "useCoverAsFolderIconCb";
@@ -908,7 +920,7 @@ namespace LibationWinForms.Dialogs
inProgressFilesGb.Controls.Add(inProgressDescLbl);
inProgressFilesGb.Location = new System.Drawing.Point(6, 397);
inProgressFilesGb.Name = "inProgressFilesGb";
inProgressFilesGb.Size = new System.Drawing.Size(842, 148);
inProgressFilesGb.Size = new System.Drawing.Size(808, 148);
inProgressFilesGb.TabIndex = 21;
inProgressFilesGb.TabStop = false;
inProgressFilesGb.Text = "In progress files";
@@ -918,7 +930,7 @@ namespace LibationWinForms.Dialogs
inProgressSelectControl.Anchor = System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right;
inProgressSelectControl.Location = new System.Drawing.Point(6, 65);
inProgressSelectControl.Name = "inProgressSelectControl";
inProgressSelectControl.Size = new System.Drawing.Size(830, 80);
inProgressSelectControl.Size = new System.Drawing.Size(796, 80);
inProgressSelectControl.TabIndex = 19;
//
// customFileNamingGb
@@ -936,7 +948,7 @@ namespace LibationWinForms.Dialogs
customFileNamingGb.Controls.Add(folderTemplateLbl);
customFileNamingGb.Location = new System.Drawing.Point(7, 204);
customFileNamingGb.Name = "customFileNamingGb";
customFileNamingGb.Size = new System.Drawing.Size(842, 187);
customFileNamingGb.Size = new System.Drawing.Size(808, 187);
customFileNamingGb.TabIndex = 20;
customFileNamingGb.TabStop = false;
customFileNamingGb.Text = "Custom file naming";
@@ -955,7 +967,7 @@ namespace LibationWinForms.Dialogs
// chapterFileTemplateBtn
//
chapterFileTemplateBtn.Anchor = System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right;
chapterFileTemplateBtn.Location = new System.Drawing.Point(762, 124);
chapterFileTemplateBtn.Location = new System.Drawing.Point(728, 124);
chapterFileTemplateBtn.Name = "chapterFileTemplateBtn";
chapterFileTemplateBtn.Size = new System.Drawing.Size(75, 23);
chapterFileTemplateBtn.TabIndex = 8;
@@ -969,7 +981,7 @@ namespace LibationWinForms.Dialogs
chapterFileTemplateTb.Location = new System.Drawing.Point(6, 125);
chapterFileTemplateTb.Name = "chapterFileTemplateTb";
chapterFileTemplateTb.ReadOnly = true;
chapterFileTemplateTb.Size = new System.Drawing.Size(750, 23);
chapterFileTemplateTb.Size = new System.Drawing.Size(716, 23);
chapterFileTemplateTb.TabIndex = 7;
//
// chapterFileTemplateLbl
@@ -984,7 +996,7 @@ namespace LibationWinForms.Dialogs
// fileTemplateBtn
//
fileTemplateBtn.Anchor = System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right;
fileTemplateBtn.Location = new System.Drawing.Point(762, 80);
fileTemplateBtn.Location = new System.Drawing.Point(728, 80);
fileTemplateBtn.Name = "fileTemplateBtn";
fileTemplateBtn.Size = new System.Drawing.Size(75, 23);
fileTemplateBtn.TabIndex = 5;
@@ -998,7 +1010,7 @@ namespace LibationWinForms.Dialogs
fileTemplateTb.Location = new System.Drawing.Point(6, 81);
fileTemplateTb.Name = "fileTemplateTb";
fileTemplateTb.ReadOnly = true;
fileTemplateTb.Size = new System.Drawing.Size(750, 23);
fileTemplateTb.Size = new System.Drawing.Size(716, 23);
fileTemplateTb.TabIndex = 4;
//
// fileTemplateLbl
@@ -1013,7 +1025,7 @@ namespace LibationWinForms.Dialogs
// folderTemplateBtn
//
folderTemplateBtn.Anchor = System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right;
folderTemplateBtn.Location = new System.Drawing.Point(762, 36);
folderTemplateBtn.Location = new System.Drawing.Point(728, 36);
folderTemplateBtn.Name = "folderTemplateBtn";
folderTemplateBtn.Size = new System.Drawing.Size(75, 23);
folderTemplateBtn.TabIndex = 2;
@@ -1027,7 +1039,7 @@ namespace LibationWinForms.Dialogs
folderTemplateTb.Location = new System.Drawing.Point(5, 37);
folderTemplateTb.Name = "folderTemplateTb";
folderTemplateTb.ReadOnly = true;
folderTemplateTb.Size = new System.Drawing.Size(750, 23);
folderTemplateTb.Size = new System.Drawing.Size(716, 23);
folderTemplateTb.TabIndex = 1;
//
// folderTemplateLbl
@@ -1068,30 +1080,6 @@ namespace LibationWinForms.Dialogs
tab4AudioFileOptions.TabIndex = 3;
tab4AudioFileOptions.Text = "Audio File Options";
//
// tab5Audiobookshelf
//
tab5Audiobookshelf.AutoScroll = true;
tab5Audiobookshelf.BackColor = System.Drawing.SystemColors.Window;
tab5Audiobookshelf.Controls.Add(absEnabledCb);
tab5Audiobookshelf.Controls.Add(absIncludePdfsCb);
tab5Audiobookshelf.Controls.Add(absPlaintextWarningLbl);
tab5Audiobookshelf.Controls.Add(absUrlLbl);
tab5Audiobookshelf.Controls.Add(absUrlTb);
tab5Audiobookshelf.Controls.Add(absTokenLbl);
tab5Audiobookshelf.Controls.Add(absTokenTb);
tab5Audiobookshelf.Controls.Add(absConnectBtn);
tab5Audiobookshelf.Controls.Add(absStatusLbl);
tab5Audiobookshelf.Controls.Add(absLibraryLbl);
tab5Audiobookshelf.Controls.Add(absLibraryCb);
tab5Audiobookshelf.Controls.Add(absFolderLbl);
tab5Audiobookshelf.Controls.Add(absFolderCb);
tab5Audiobookshelf.Location = new System.Drawing.Point(4, 24);
tab5Audiobookshelf.Name = "tab5Audiobookshelf";
tab5Audiobookshelf.Padding = new System.Windows.Forms.Padding(3);
tab5Audiobookshelf.Size = new System.Drawing.Size(856, 457);
tab5Audiobookshelf.TabIndex = 4;
tab5Audiobookshelf.Text = "Audiobookshelf";
//
// request_xHE_AAC_Cbox
//
request_xHE_AAC_Cbox.CheckAlign = System.Drawing.ContentAlignment.MiddleRight;
@@ -1699,20 +1687,47 @@ namespace LibationWinForms.Dialogs
createCueSheetCbox.UseVisualStyleBackColor = true;
createCueSheetCbox.CheckedChanged += allowLibationFixupCbox_CheckedChanged;
//
// tab5Audiobookshelf
//
tab5Audiobookshelf.AutoScroll = true;
tab5Audiobookshelf.BackColor = System.Drawing.SystemColors.Window;
tab5Audiobookshelf.Controls.Add(absEnabledCb);
tab5Audiobookshelf.Controls.Add(absIncludePdfsCb);
tab5Audiobookshelf.Controls.Add(absPlaintextWarningLbl);
tab5Audiobookshelf.Controls.Add(absUrlLbl);
tab5Audiobookshelf.Controls.Add(absUrlTb);
tab5Audiobookshelf.Controls.Add(absTokenLbl);
tab5Audiobookshelf.Controls.Add(absTokenTb);
tab5Audiobookshelf.Controls.Add(absConnectBtn);
tab5Audiobookshelf.Controls.Add(absStatusLbl);
tab5Audiobookshelf.Controls.Add(absLibraryLbl);
tab5Audiobookshelf.Controls.Add(absLibraryCb);
tab5Audiobookshelf.Controls.Add(absFolderLbl);
tab5Audiobookshelf.Controls.Add(absFolderCb);
tab5Audiobookshelf.Location = new System.Drawing.Point(4, 24);
tab5Audiobookshelf.Name = "tab5Audiobookshelf";
tab5Audiobookshelf.Padding = new System.Windows.Forms.Padding(3);
tab5Audiobookshelf.Size = new System.Drawing.Size(856, 457);
tab5Audiobookshelf.TabIndex = 4;
tab5Audiobookshelf.Text = "Audiobookshelf";
//
// absEnabledCb
//
absEnabledCb.AutoSize = true;
absEnabledCb.Location = new System.Drawing.Point(6, 6);
absEnabledCb.Name = "absEnabledCb";
absEnabledCb.Size = new System.Drawing.Size(280, 19);
absEnabledCb.Size = new System.Drawing.Size(187, 19);
absEnabledCb.TabIndex = 0;
absEnabledCb.Text = "[AudiobookshelfEnabled desc]";
absEnabledCb.UseVisualStyleBackColor = true;
absEnabledCb.CheckedChanged += absEnabledCb_CheckedChanged;
//
// absIncludePdfsCb
//
absIncludePdfsCb.AutoSize = true;
absIncludePdfsCb.Location = new System.Drawing.Point(6, 32);
absIncludePdfsCb.Name = "absIncludePdfsCb";
absIncludePdfsCb.Size = new System.Drawing.Size(350, 19);
absIncludePdfsCb.Size = new System.Drawing.Size(207, 19);
absIncludePdfsCb.TabIndex = 1;
absIncludePdfsCb.Text = "[AudiobookshelfIncludePdfs desc]";
absIncludePdfsCb.UseVisualStyleBackColor = true;
@@ -1723,7 +1738,7 @@ namespace LibationWinForms.Dialogs
absPlaintextWarningLbl.ForeColor = System.Drawing.Color.DarkOrange;
absPlaintextWarningLbl.Location = new System.Drawing.Point(6, 56);
absPlaintextWarningLbl.Name = "absPlaintextWarningLbl";
absPlaintextWarningLbl.Size = new System.Drawing.Size(480, 15);
absPlaintextWarningLbl.Size = new System.Drawing.Size(327, 15);
absPlaintextWarningLbl.TabIndex = 2;
absPlaintextWarningLbl.Text = "Warning: The API token is stored as plaintext in Settings.json.";
//
@@ -1732,7 +1747,7 @@ namespace LibationWinForms.Dialogs
absUrlLbl.AutoSize = true;
absUrlLbl.Location = new System.Drawing.Point(6, 81);
absUrlLbl.Name = "absUrlLbl";
absUrlLbl.Size = new System.Drawing.Size(70, 15);
absUrlLbl.Size = new System.Drawing.Size(173, 15);
absUrlLbl.TabIndex = 3;
absUrlLbl.Text = "[AudiobookshelfServerUrl desc]";
//
@@ -1749,7 +1764,7 @@ namespace LibationWinForms.Dialogs
absTokenLbl.AutoSize = true;
absTokenLbl.Location = new System.Drawing.Point(6, 110);
absTokenLbl.Name = "absTokenLbl";
absTokenLbl.Size = new System.Drawing.Size(65, 15);
absTokenLbl.Size = new System.Drawing.Size(176, 15);
absTokenLbl.TabIndex = 5;
absTokenLbl.Text = "[AudiobookshelfApiToken desc]";
//
@@ -1779,14 +1794,13 @@ namespace LibationWinForms.Dialogs
absStatusLbl.Name = "absStatusLbl";
absStatusLbl.Size = new System.Drawing.Size(0, 15);
absStatusLbl.TabIndex = 8;
absStatusLbl.Text = "";
//
// absLibraryLbl
//
absLibraryLbl.AutoSize = true;
absLibraryLbl.Location = new System.Drawing.Point(6, 166);
absLibraryLbl.Name = "absLibraryLbl";
absLibraryLbl.Size = new System.Drawing.Size(50, 15);
absLibraryLbl.Size = new System.Drawing.Size(172, 15);
absLibraryLbl.TabIndex = 9;
absLibraryLbl.Text = "[AudiobookshelfLibraryId desc]";
//
@@ -1806,7 +1820,7 @@ namespace LibationWinForms.Dialogs
absFolderLbl.AutoSize = true;
absFolderLbl.Location = new System.Drawing.Point(6, 196);
absFolderLbl.Name = "absFolderLbl";
absFolderLbl.Size = new System.Drawing.Size(45, 15);
absFolderLbl.Size = new System.Drawing.Size(169, 15);
absFolderLbl.TabIndex = 11;
absFolderLbl.Text = "[AudiobookshelfFolderId desc]";
//
@@ -2028,5 +2042,6 @@ namespace LibationWinForms.Dialogs
private System.Windows.Forms.ComboBox absLibraryCb;
private System.Windows.Forms.Label absFolderLbl;
private System.Windows.Forms.ComboBox absFolderCb;
private System.Windows.Forms.CheckBox preReleaseCbox;
}
}

View File

@@ -43,7 +43,9 @@ public partial class SettingsDialog
gridScaleFactorLbl.Text = desc(nameof(config.GridScaleFactor));
gridFontScaleFactorLbl.Text = desc(nameof(config.GridFontScaleFactor));
checkForUpgradesCbox.Text = desc(nameof(config.CheckForUpgradesAtStartup));
preReleaseCbox.Text = desc(nameof(config.CheckForPreRelease));
toolTip.SetToolTip(checkForUpgradesCbox, Configuration.GetHelpText(nameof(config.CheckForUpgradesAtStartup)));
toolTip.SetToolTip(preReleaseCbox, Configuration.GetHelpText(nameof(config.CheckForPreRelease)));
var dateTimeSources = Enum.GetValues<Configuration.DateTimeSource>().Select(v => new EnumDisplay<Configuration.DateTimeSource>(v)).ToArray();
creationTimeCb.Items.AddRange(dateTimeSources);
@@ -73,9 +75,11 @@ public partial class SettingsDialog
saveEpisodesToSeriesFolderCbox.Checked = config.SavePodcastsToParentFolder;
overwriteExistingCbox.Checked = config.OverwriteExisting;
checkForUpgradesCbox.Checked = config.CheckForUpgradesAtStartup;
preReleaseCbox.Checked = config.CheckForPreRelease;
gridScaleFactorTbar.Value = scaleFactorToLinearRange(config.GridScaleFactor);
gridFontScaleFactorTbar.Value = scaleFactorToLinearRange(config.GridFontScaleFactor);
checkForUpgradesCbox_CheckedChanged(this, EventArgs.Empty);
Load_TokenStorage(config);
}
@@ -199,6 +203,7 @@ public partial class SettingsDialog
config.SavePodcastsToParentFolder = saveEpisodesToSeriesFolderCbox.Checked;
config.OverwriteExisting = overwriteExistingCbox.Checked;
config.CheckForUpgradesAtStartup = checkForUpgradesCbox.Checked;
config.CheckForPreRelease = preReleaseCbox.Checked;
config.CreationTime = (creationTimeCb.SelectedItem as EnumDisplay<Configuration.DateTimeSource>)?.Value ?? Configuration.DateTimeSource.File;
config.LastWriteTime = (lastWriteTimeCb.SelectedItem as EnumDisplay<Configuration.DateTimeSource>)?.Value ?? Configuration.DateTimeSource.File;
@@ -237,4 +242,9 @@ public partial class SettingsDialog
themeLbl.Visible = themeVariant != initialThemeVariant;
}
}
private void checkForUpgradesCbox_CheckedChanged(object sender, EventArgs e)
{
preReleaseCbox.Enabled = checkForUpgradesCbox.Checked;
}
}

View File

@@ -54,7 +54,7 @@
this.promptLbl.Name = "promptLbl";
this.promptLbl.Size = new System.Drawing.Size(416, 21);
this.promptLbl.TabIndex = 0;
this.promptLbl.Text = "There is a new version available. Would you like to update?";
this.promptLbl.Text = "There is a new {0} available. Would you like to update?";
//
// promptDetailLbl
//

View File

@@ -22,13 +22,14 @@ public partial class UpgradeNotificationDialog : Form
PackageUrl = upgradeProperties.ZipUrl;
packageDlLink.Text = upgradeProperties.ZipName;
releaseNotesTbox.Text = upgradeProperties.Notes;
promptLbl.Text = string.Format(promptLbl.Text, upgradeProperties.IsPreRelease ? "pre-release" : "release");
if (!canUpgrade)
{
// Without a Yes button this is a notice, so it must stop asking a question that no
// longer has an answer. Both labels take one line before the release notes box begins,
// which is why this takes the one-line summary and not the full explanation.
promptLbl.Text = "There is a new version available.";
promptLbl.Text = string.Format("There is a new {0} available.", upgradeProperties.IsPreRelease ? "pre-release" : "release");
promptDetailLbl.Text = upgradeUnavailableSummary ?? "Libation cannot install this update itself. Use the download link below.";
yesBtn.Visible = false;
noBtn.Text = "OK";

View File

@@ -1,5 +1,6 @@
using AppScaffolding;
using LibationFileManager;
using NuGet.Versioning;
using System.Diagnostics;
using System.Linq;
using System.Threading.Tasks;
@@ -33,7 +34,7 @@ internal class LinuxInterop : IInteropFunctions
//.deb or .rpm package. Try to detect this by checking if the symlink exists.
public bool CanUpgrade => File.Exists("/usr/bin/libation") || File.Exists("/bin/libation");
public async Task InstallUpgradeAsync(string upgradeBundle, Version targetVersion)
public async Task InstallUpgradeAsync(string upgradeBundle, NuGetVersion targetVersion)
{
if (string.IsNullOrWhiteSpace(upgradeBundle) || !File.Exists(upgradeBundle))
throw new FileNotFoundException("Upgrade bundle not found.", upgradeBundle);

View File

@@ -19,7 +19,7 @@
<key>CFBundleIconFile</key>
<string>libation.icns</string>
<key>CFBundleVersion</key>
<string>VERSION_STRING</string>
<string>VERSION_NUM</string>
<key>CFBundleShortVersionString</key>
<string>VERSION_STRING</string>
</dict>

View File

@@ -1,5 +1,6 @@
using Dinah.Core;
using LibationFileManager;
using NuGet.Versioning;
using System.Diagnostics;
using System.IO;
using System.Threading.Tasks;
@@ -46,7 +47,7 @@ internal class MacOSInterop : IInteropFunctions
public string ReleaseIdString => AppScaffolding.LibationScaffolding.ReleaseIdentifier.ToString();
public Task InstallUpgradeAsync(string upgradeBundle, Version targetVersion)
public Task InstallUpgradeAsync(string upgradeBundle, NuGetVersion targetVersion)
{
Serilog.Log.Information($"Extracting upgrade bundle to {AppPath} (target version {targetVersion})");

View File

@@ -1,5 +1,6 @@
using Dinah.Core;
using LibationFileManager;
using NuGet.Versioning;
using System;
using System.Diagnostics;
using System.IO;
@@ -32,7 +33,7 @@ internal class WinInterop : IInteropFunctions
public string ReleaseIdString => AppScaffolding.LibationScaffolding.ReleaseIdentifier.ToString();
public async Task InstallUpgradeAsync(string upgradeBundle, Version targetVersion)
public async Task InstallUpgradeAsync(string upgradeBundle, NuGetVersion targetVersion)
{
const string ExtractorExeName = "ZipExtractor.exe";
var thisExe = Environment.ProcessPath;

View File

@@ -1,5 +1,6 @@
using LibationFileManager;
using Microsoft.Win32;
using NuGet.Versioning;
using System;
using System.Diagnostics;
using System.IO;
@@ -90,7 +91,7 @@ internal static class WindowsUninstallRegistrySync
return null;
raw = raw.Split('+')[0].Split('-')[0].Trim();
return Version.TryParse(raw, out var version) ? version.ToVersionString() : null;
return NuGetVersion.TryParse(raw, out var version) ? version.ToVersionString() : null;
}
private static string? getDisplayName(string installDir)

View File

@@ -1,4 +1,5 @@
using Microsoft.VisualStudio.TestTools.UnitTesting;
using NuGet.Versioning;
using System;
using System.IO;
using System.IO.Compression;
@@ -47,7 +48,7 @@ public class InstallUpgradeManagerTests
("AppScaffolding.dll", "new-app-scaffolding"),
("Microsoft.EntityFrameworkCore.Sqlite.dll", "new-ef"));
InstallUpgradeManager.PrepareForUpgrade(_installDir, zipPath, new Version(9, 9, 9));
InstallUpgradeManager.PrepareForUpgrade(_installDir, zipPath, new NuGetVersion(9, 9, 9));
Assert.IsTrue(File.Exists(InstallUpgradeManager.GetPendingStatePath(_installDir)));
Assert.IsTrue(File.Exists(Path.Combine(InstallUpgradeManager.GetBackupDirectory(_installDir), "LibationUiBase.dll")));
@@ -68,7 +69,7 @@ public class InstallUpgradeManagerTests
("AppScaffolding.dll", "new-app-scaffolding"),
("Microsoft.EntityFrameworkCore.Sqlite.dll", "new-ef"));
InstallUpgradeManager.PrepareForUpgrade(_installDir, zipPath, new Version(9, 9, 9));
InstallUpgradeManager.PrepareForUpgrade(_installDir, zipPath, new NuGetVersion(9, 9, 9));
// Simulate a partial overlay: only some files updated.
WriteInstallFile("LibationFileManager.dll", "new-file-manager");
@@ -105,7 +106,7 @@ public class InstallUpgradeManagerTests
("LibationUiBase.dll", "new-ui-base"),
("LibationFileManager.dll", "new-file-manager"));
InstallUpgradeManager.PrepareForUpgrade(_installDir, zipPath, new Version(9, 9, 9));
InstallUpgradeManager.PrepareForUpgrade(_installDir, zipPath, new NuGetVersion(9, 9, 9));
// A partial overlay: LibationUiBase.dll was never replaced.
WriteInstallFile("LibationFileManager.dll", "new-file-manager");
@@ -131,7 +132,7 @@ public class InstallUpgradeManagerTests
("LibationUiBase.dll", "new-ui-base"),
("LibationFileManager.dll", "new-file-manager"));
InstallUpgradeManager.PrepareForUpgrade(_installDir, zipPath, new Version(9, 9, 9));
InstallUpgradeManager.PrepareForUpgrade(_installDir, zipPath, new NuGetVersion(9, 9, 9));
WriteInstallFile("LibationUiBase.dll", "new-ui-base");
// LibationFileManager.dll keeps its old contents, so verification fails and a rollback follows.
@@ -166,7 +167,7 @@ public class InstallUpgradeManagerTests
("LibationUiBase.dll", "new-ui-base"),
("LibationFileManager.dll", "new-file-manager"));
InstallUpgradeManager.PrepareForUpgrade(_installDir, zipPath, new Version(9, 9, 9));
InstallUpgradeManager.PrepareForUpgrade(_installDir, zipPath, new NuGetVersion(9, 9, 9));
// Nothing was replaced: ZipExtractor never ran.
var recovery = InstallUpgradeManager.RecoverPendingUpgradeIfNeeded(_installDir);
@@ -187,7 +188,7 @@ public class InstallUpgradeManagerTests
("LibationUiBase.dll", "new-ui-base"),
("LibationFileManager.dll", "new-file-manager"));
InstallUpgradeManager.PrepareForUpgrade(_installDir, zipPath, new Version(9, 9, 9));
InstallUpgradeManager.PrepareForUpgrade(_installDir, zipPath, new NuGetVersion(9, 9, 9));
// One file was replaced and one was not, so the overlay was underway when it stopped. The backup
// covers a dozen names out of hundreds, so restoring them cannot undo what else it replaced.
@@ -211,7 +212,7 @@ public class InstallUpgradeManagerTests
("LibationUiBase.dll", "new-ui-base"),
("LibationFileManager.dll", "new-file-manager"));
InstallUpgradeManager.PrepareForUpgrade(_installDir, zipPath, new Version(9, 9, 9));
InstallUpgradeManager.PrepareForUpgrade(_installDir, zipPath, new NuGetVersion(9, 9, 9));
// Make one backup file unreadable so its restore fails while the other succeeds.
var unreadableBackup = Path.Combine(InstallUpgradeManager.GetBackupDirectory(_installDir), "LibationUiBase.dll");
@@ -256,7 +257,7 @@ public class InstallUpgradeManagerTests
("AppScaffolding.dll", "new-app-scaffolding"),
("Microsoft.EntityFrameworkCore.Sqlite.dll", "new-ef"));
InstallUpgradeManager.PrepareForUpgrade(_installDir, zipPath, new Version(9, 9, 9));
InstallUpgradeManager.PrepareForUpgrade(_installDir, zipPath, new NuGetVersion(9, 9, 9));
WriteInstallFile("LibationUiBase.dll", "new-ui-base");
WriteInstallFile("LibationFileManager.dll", "new-file-manager");
@@ -273,7 +274,7 @@ public class InstallUpgradeManagerTests
public void VerifyInstallMatchesUpgrade_reports_missing_files()
{
var zipPath = CreateUpgradeZip(("LibationUiBase.dll", "new-ui-base"));
InstallUpgradeManager.PrepareForUpgrade(_installDir, zipPath, new Version(1, 2, 3));
InstallUpgradeManager.PrepareForUpgrade(_installDir, zipPath, new NuGetVersion(1, 2, 3));
File.Delete(Path.Combine(_installDir, "LibationUiBase.dll"));