From 96e886d20753c63ea559860a58928dd037012f72 Mon Sep 17 00:00:00 2001 From: rmcrackan Date: Wed, 8 Jan 2025 10:04:55 -0500 Subject: [PATCH 1/4] Update FrequentlyAskedQuestions.md Brazil login --- Documentation/FrequentlyAskedQuestions.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Documentation/FrequentlyAskedQuestions.md b/Documentation/FrequentlyAskedQuestions.md index e800ecd9..163c989a 100644 --- a/Documentation/FrequentlyAskedQuestions.md +++ b/Documentation/FrequentlyAskedQuestions.md @@ -31,6 +31,10 @@ Self-hosting online: * [audiobookshelf](https://www.audiobookshelf.org). On [reddit](https://www.reddit.com/r/audiobookshelf/) * [plex](https://www.plex.tv/). Listen with [Prologue](https://prologue.audio/) (iOS) +## Q: I'm having trouble loggin into my Brazil account. + +For reasons known only to Jeff Bezos and God, amazon and audible brazil handle logins slightly differently. [See this ticket for more details.](https://github.com/rmcrackan/Libation/issues/1103) + ## Q: How do I use Libation with a South Africa account? **A:** Like many countries, amazon gives South Africa it's own amazon site. [Unlike many other regions](https://www.audible.com/ep/country-selector) there is not South Africa specific audible site. Use `US` for your region -- ie: audible.com. From 14ba04c28b629768cd4d808a29669745d48ea3ff Mon Sep 17 00:00:00 2001 From: rmcrackan Date: Mon, 13 Jan 2025 09:26:52 -0500 Subject: [PATCH 2/4] Update Docker.md --- Documentation/Docker.md | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/Documentation/Docker.md b/Documentation/Docker.md index 09ca1cdb..8b33d51a 100644 --- a/Documentation/Docker.md +++ b/Documentation/Docker.md @@ -5,7 +5,7 @@ > [!WARNING] > ## Breaking Changes -> * The docker image now runs as user 1001 and group 1001. Make sure that the permissions on your volumes allow user 1001 to read and write to them. +> * The docker image now runs as user 1001 and group 1001. Make sure that the permissions on your volumes allow user 1001 to read and write to them or see the User section below for other options, or if you're not sure. > * `SLEEP_TIME` is now set to `-1` by default. This means the image will run once and exit. If you were relying on the previous default, you'll need to explicitly set the `SLEEP_TIME` environment variable to `30m` to replicate the previous behavior. > * The docker image now ignores the values in `Settings.json` for `Books` and `InProgress`. You can now change the folder that books are saved to by using the `LIBATION_BOOKS_DIR` environment variable. @@ -49,7 +49,9 @@ sudo docker run -d \ | LIBATION_CREATE_DB | true | Whether or not the image should create a database file if none are found. | ### User -This docker image runs as user `1001`. In order for the image to function properly, user `1001` must be able to read and write the volumes that are mounted in. If they are not, you will see errors +This docker image runs as user `1001`. In order for the image to function properly, user `1001` must be able to read and write the volumes that are mounted in. If they are not, you will see errors, including [sqlite error](#1060), [Microsoft.Data.Sqlite.SqliteException](#1110), or [Microsoft.EntityFrameworkCore.DbUpdateException](#1049) + +If you're not sure what your user number is, check the output of the `id` command. Docker should normally run with the number of the user who configured and ran it. If you want to change the user the image runs as, you can specify `-u :`. For example, to run it as user `2000` and group `3000`, you could do the following: @@ -63,5 +65,7 @@ sudo docker run -d \ rmcrackan/libation:latest ``` +If the user it's running as is correct, and it still cannot write, be sure to check whether the files and/or folders might be owned by the wrong user. You can use the `chown` command to change the owner of the file to the correct user and group number, for example: `chown -R 1001:1001 /mnt/audiobooks /mnt/libation-config` + ### Advanced Database Options -The docker image supports an optional database mount location defined by `LIBATION_DB_DIR`. This allows the database to be mounted as read/write, while allowing the rest of the configuration files to be mounted as read only. This is specifically useful if running in Kubernetes where you can use Configmaps and Secrets to define the configuration. If the `LIBATION_DB_DIR` is mounted, it will be used, otherwise it will look for the database in `LIBATION_CONFIG_DIR`. If it does not find the database in the expected location, it will attempt to make an empty database there. \ No newline at end of file +The docker image supports an optional database mount location defined by `LIBATION_DB_DIR`. This allows the database to be mounted as read/write, while allowing the rest of the configuration files to be mounted as read only. This is specifically useful if running in Kubernetes where you can use Configmaps and Secrets to define the configuration. If the `LIBATION_DB_DIR` is mounted, it will be used, otherwise it will look for the database in `LIBATION_CONFIG_DIR`. If it does not find the database in the expected location, it will attempt to make an empty database there. From 65c64c45044827e990bcabf0c08c54086a65e94f Mon Sep 17 00:00:00 2001 From: rmcrackan Date: Mon, 13 Jan 2025 09:28:55 -0500 Subject: [PATCH 3/4] Update Docker.md --- Documentation/Docker.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Documentation/Docker.md b/Documentation/Docker.md index 8b33d51a..0a9b821b 100644 --- a/Documentation/Docker.md +++ b/Documentation/Docker.md @@ -49,7 +49,7 @@ sudo docker run -d \ | LIBATION_CREATE_DB | true | Whether or not the image should create a database file if none are found. | ### User -This docker image runs as user `1001`. In order for the image to function properly, user `1001` must be able to read and write the volumes that are mounted in. If they are not, you will see errors, including [sqlite error](#1060), [Microsoft.Data.Sqlite.SqliteException](#1110), or [Microsoft.EntityFrameworkCore.DbUpdateException](#1049) +This docker image runs as user `1001`. In order for the image to function properly, user `1001` must be able to read and write the volumes that are mounted in. If they are not, you will see errors, including [sqlite error](#1060), [Microsoft.Data.Sqlite.SqliteException](#1110), [unable to open database file](#1113), [Microsoft.EntityFrameworkCore.DbUpdateException](#1049) If you're not sure what your user number is, check the output of the `id` command. Docker should normally run with the number of the user who configured and ran it. From 13aad1a7cb1a4302cad451b44d32175edf2ba37e Mon Sep 17 00:00:00 2001 From: Michael Bucari-Tovo Date: Thu, 16 Jan 2025 10:24:57 -0700 Subject: [PATCH 4/4] Restrict audio sample rate settings to allowed values (#1116) --- Source/AppScaffolding/LibationScaffolding.cs | 14 ++++++++++++-- .../ViewModels/Settings/AudioSettingsVM.cs | 4 +++- .../Dialogs/SettingsDialog.AudioSettings.cs | 1 + 3 files changed, 16 insertions(+), 3 deletions(-) diff --git a/Source/AppScaffolding/LibationScaffolding.cs b/Source/AppScaffolding/LibationScaffolding.cs index 917ac9d7..229cdce4 100644 --- a/Source/AppScaffolding/LibationScaffolding.cs +++ b/Source/AppScaffolding/LibationScaffolding.cs @@ -89,7 +89,8 @@ namespace AppScaffolding Migrations.migrate_to_v6_6_9(config); Migrations.migrate_to_v11_5_0(config); - } + Migrations.migrate_to_v11_6_5(config); + } /// Initialize logging. Wire-up events. Run after migration public static void RunPostMigrationScaffolding(Variety variety, Configuration config) @@ -413,7 +414,16 @@ namespace AppScaffolding public List Filters { get; set; } = new(); } - public static void migrate_to_v11_5_0(Configuration config) + public static void migrate_to_v11_6_5(Configuration config) + { + //Settings migration for unsupported sample rates (#1116) + if (config.MaxSampleRate < AAXClean.SampleRate.Hz_8000) + config.MaxSampleRate = AAXClean.SampleRate.Hz_8000; + else if (config.MaxSampleRate > AAXClean.SampleRate.Hz_48000) + config.MaxSampleRate = AAXClean.SampleRate.Hz_48000; + } + + public static void migrate_to_v11_5_0(Configuration config) { // Read file, but convert old format to new (with Name field) as necessary. if (!File.Exists(QuickFilters.JsonFile)) diff --git a/Source/LibationAvalonia/ViewModels/Settings/AudioSettingsVM.cs b/Source/LibationAvalonia/ViewModels/Settings/AudioSettingsVM.cs index f8f96dfb..148ca1da 100644 --- a/Source/LibationAvalonia/ViewModels/Settings/AudioSettingsVM.cs +++ b/Source/LibationAvalonia/ViewModels/Settings/AudioSettingsVM.cs @@ -25,7 +25,9 @@ namespace LibationAvalonia.ViewModels.Settings public NAudio.Lame.EncoderQuality SelectedEncoderQuality { get; set; } public AvaloniaList> SampleRates { get; } - = new(Enum.GetValues().Select(v => new EnumDiaplay(v, $"{(int)v} Hz"))); + = new(Enum.GetValues() + .Where(r => r >= SampleRate.Hz_8000 && r <= SampleRate.Hz_48000) + .Select(v => new EnumDiaplay(v, $"{(int)v} Hz"))); public AvaloniaList EncoderQualities { get; } = new( diff --git a/Source/LibationWinForms/Dialogs/SettingsDialog.AudioSettings.cs b/Source/LibationWinForms/Dialogs/SettingsDialog.AudioSettings.cs index 32c1fc5e..bc5ca171 100644 --- a/Source/LibationWinForms/Dialogs/SettingsDialog.AudioSettings.cs +++ b/Source/LibationWinForms/Dialogs/SettingsDialog.AudioSettings.cs @@ -41,6 +41,7 @@ namespace LibationWinForms.Dialogs maxSampleRateCb.Items.AddRange( Enum.GetValues() + .Where(r => r >= AAXClean.SampleRate.Hz_8000 && r <= AAXClean.SampleRate.Hz_48000) .Select(v => new EnumDiaplay(v, $"{(int)v} Hz")) .ToArray());