From e096ae77087842909feb0823f7f1b8be784e4f4c Mon Sep 17 00:00:00 2001 From: Balazs Perlaki-Horvath Date: Fri, 16 Feb 2024 09:58:53 +0100 Subject: [PATCH 1/3] Fix nighly folder --- .github/workflows/cd.yml | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index 92abcb4e..76faa8d0 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -1,13 +1,14 @@ name: CD -# | Platform | Nightly | Weekly (if diff HEAD) | TestFlight Tag | Post App Release | -# |----------|---------|------------------------|----------------|------------------| -# | macOS | ftp | app-store | app-store | ftp | -# | iOS | ftp | app-store | app-store | - | -# |----------|---------|------------------------|----------------|------------------| -# | VERSION | Date | get from project.yml | project.yml | project.yml | -# |----------|---------|------------------------|----------------|------------------| - +# | Platform | Nightly | Weekly (if diff HEAD) | TestFlight Tag | Post App Release | +# |-----------------|---------|------------------------|----------------|------------------| +# | macOS | ftp | app-store | app-store | ftp | +# | iOS | ftp | app-store | app-store | - | +# |-----------------|---------|------------------------|----------------|------------------| +# | VERSION | Date | get from project.yml | project.yml | project.yml | +# |-----------------|---------|------------------------|----------------|------------------| +# | UPLOAD_FOLDER | nightly | - | - | release | +# |-----------------|---------|------------------------|----------------|------------------| on: schedule: - cron: '32 1 * * *' # NIGHTLY @ 01:32 @@ -84,7 +85,7 @@ jobs: with open(os.getenv("GITHUB_ENV"), "a") as fh: fh.write(f"VERSION={version}\n") fh.write(f"UPLOAD_TO=ftp\n") - fh.write(f"UPLOAD_FOLDER=release/{version}\n") + fh.write(f"UPLOAD_FOLDER=nightly/{version}\n") - name: Weekly setup if: github.event_name == 'schedule' && github.event.schedule == '00 2 * * 1' && env.HAS_CHANGED_LAST_WEEK == 'yes' From 97a6e599ef59a40811bd9ca0bff866932c733a05 Mon Sep 17 00:00:00 2001 From: Balazs Perlaki-Horvath Date: Thu, 15 Feb 2024 22:42:22 +0100 Subject: [PATCH 2/3] Fix default langauge for library filtering --- ViewModel/LibraryViewModel.swift | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/ViewModel/LibraryViewModel.swift b/ViewModel/LibraryViewModel.swift index 14059c1a..1305282a 100644 --- a/ViewModel/LibraryViewModel.swift +++ b/ViewModel/LibraryViewModel.swift @@ -56,10 +56,19 @@ public class LibraryViewModel: ObservableObject { Defaults[.libraryLastRefresh] = Date() // populate library language code if there isn't one set already - if Defaults[.libraryLanguageCodes].isEmpty, let currentLanguageCode = Locale.current.languageCode { - Defaults[.libraryLanguageCodes] = [currentLanguageCode] + let currentLanguageCode: String? + if #available(iOS 16, *) { + currentLanguageCode = Locale.current.language.languageCode?.identifier(.alpha3) + } else { + // Locale.current.languageCode is returning a 2 char lang code, eg: "en" + // we want a 3 char value, eg: "eng", otherwise we filter out every results + // and end up with an empty list in the categories + currentLanguageCode = "eng" + } + if Defaults[.libraryLanguageCodes].isEmpty, + let currentLanguageCode { + Defaults[.libraryLanguageCodes] = [currentLanguageCode] } - // reset error error = nil From 447f10ef5b67113648efb736aa1383c59be0162f Mon Sep 17 00:00:00 2001 From: Balazs Perlaki-Horvath Date: Thu, 15 Feb 2024 22:52:56 +0100 Subject: [PATCH 3/3] Include macOS available in macro --- ViewModel/LibraryViewModel.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ViewModel/LibraryViewModel.swift b/ViewModel/LibraryViewModel.swift index 1305282a..35ef79b5 100644 --- a/ViewModel/LibraryViewModel.swift +++ b/ViewModel/LibraryViewModel.swift @@ -57,7 +57,7 @@ public class LibraryViewModel: ObservableObject { // populate library language code if there isn't one set already let currentLanguageCode: String? - if #available(iOS 16, *) { + if #available(iOS 16, macOS 13, *) { currentLanguageCode = Locale.current.language.languageCode?.identifier(.alpha3) } else { // Locale.current.languageCode is returning a 2 char lang code, eg: "en"