From d023a943c13bf4b9dae3c476f25a2534c2dcf796 Mon Sep 17 00:00:00 2001 From: William Tanksley Date: Mon, 9 Jan 2023 13:12:12 -0800 Subject: [PATCH 1/2] Add a version parameter to DEB creation, do sanity checks, use it. --- Source/targz2deb.sh | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/Source/targz2deb.sh b/Source/targz2deb.sh index d5591f48..67c675ee 100644 --- a/Source/targz2deb.sh +++ b/Source/targz2deb.sh @@ -1,6 +1,7 @@ #!/bin/bash -FILE=$1 +FILE=$1; shift +VERSION=$1; shift if [ -z "$FILE" ] then @@ -14,6 +15,20 @@ then exit fi +if [ -z "$VERSION" ] +then + echo "This script must be called with the Libation version number as an argument." + exit +fi + +contains() { case "$1" in *"$2"*) true ;; *) false ;; esac } + +if ! contains "$FILE" "$VERSION" +then + echo "This script must be called with a Libation version number that is present in the filename passed." + exit +fi + # remove trailing ".tar.gz" FOLDER_MAIN=${FILE::-7} echo "Working dir: $FOLDER_MAIN" @@ -97,7 +112,7 @@ chmod 666 /usr/lib/libation/appsettings.json echo "Creating control file..." echo "Package: Libation -Version: 8.7.0 +Version: $VERSION Architecture: all Essential: no Priority: optional @@ -116,3 +131,4 @@ dpkg-deb --build $FOLDER_MAIN rm -r "$FOLDER_MAIN" echo "Done!" + From 7474f1221a9927c18b3e1ce6fb573ebb2efbd24b Mon Sep 17 00:00:00 2001 From: Robert McRackan Date: Mon, 9 Jan 2023 16:30:12 -0500 Subject: [PATCH 2/2] bug fix #441 -- new code with empty setting --- Source/AppScaffolding/AppScaffolding.csproj | 2 +- .../Configuration.PersistentSettings.cs | 14 +++++++------- .../Configuration.PropertyChange.cs | 3 ++- 3 files changed, 10 insertions(+), 9 deletions(-) diff --git a/Source/AppScaffolding/AppScaffolding.csproj b/Source/AppScaffolding/AppScaffolding.csproj index 1a6bc632..8491086e 100644 --- a/Source/AppScaffolding/AppScaffolding.csproj +++ b/Source/AppScaffolding/AppScaffolding.csproj @@ -2,7 +2,7 @@ net7.0 - 8.8.1.1 + 8.8.2.1 diff --git a/Source/LibationFileManager/Configuration.PersistentSettings.cs b/Source/LibationFileManager/Configuration.PersistentSettings.cs index 890617b1..6e7b280c 100644 --- a/Source/LibationFileManager/Configuration.PersistentSettings.cs +++ b/Source/LibationFileManager/Configuration.PersistentSettings.cs @@ -128,16 +128,16 @@ namespace LibationFileManager [Description("Lame target VBR quality [10,100]")] public int LameVBRQuality { get => GetNonString(); set => SetNonString(value); } - [Description("A Dictionary of GridView data property names and bool indicating its column's visibility in ProductsGrid")] - public Dictionary GridColumnsVisibilities { get => GetNonString>().Clone(); set => SetNonString(value); } + [Description("A Dictionary of GridView data property names and bool indicating its column's visibility in ProductsGrid")] + public Dictionary GridColumnsVisibilities { get => GetNonString>()?.Clone() ?? new(); set => SetNonString(value); } - [Description("A Dictionary of GridView data property names and int indicating its column's display index in ProductsGrid")] - public Dictionary GridColumnsDisplayIndices { get => GetNonString>().Clone(); set => SetNonString(value); } + [Description("A Dictionary of GridView data property names and int indicating its column's display index in ProductsGrid")] + public Dictionary GridColumnsDisplayIndices { get => GetNonString>()?.Clone() ?? new(); set => SetNonString(value); } - [Description("A Dictionary of GridView data property names and int indicating its column's width in ProductsGrid")] - public Dictionary GridColumnsWidths { get => GetNonString>().Clone(); set => SetNonString(value); } + [Description("A Dictionary of GridView data property names and int indicating its column's width in ProductsGrid")] + public Dictionary GridColumnsWidths { get => GetNonString>()?.Clone() ?? new(); set => SetNonString(value); } - [Description("Save cover image alongside audiobook?")] + [Description("Save cover image alongside audiobook?")] public bool DownloadCoverArt { get => GetNonString(); set => SetNonString(value); } [Description("Download clips and bookmarks?")] diff --git a/Source/LibationFileManager/Configuration.PropertyChange.cs b/Source/LibationFileManager/Configuration.PropertyChange.cs index f384fa3f..4abbd0b3 100644 --- a/Source/LibationFileManager/Configuration.PropertyChange.cs +++ b/Source/LibationFileManager/Configuration.PropertyChange.cs @@ -11,7 +11,8 @@ namespace LibationFileManager */ private class EquatableDictionary : Dictionary { - public EquatableDictionary(IEnumerable> keyValuePairs) : base(keyValuePairs) { } + public EquatableDictionary() { } + public EquatableDictionary(IEnumerable> keyValuePairs) : base(keyValuePairs) { } public EquatableDictionary Clone() => new(this); public override bool Equals(object obj) {