From 521a527776243add12fabc797e6444bef35ae23e Mon Sep 17 00:00:00 2001 From: DrMint <29893320+DrMint@users.noreply.github.com> Date: Sun, 14 May 2023 03:19:02 +0200 Subject: [PATCH] Added groupable years for library items --- src/core/graphql/generated.ts | 45 ++++++++++++++++++++++++++++++++++ src/core/graphql/meiliTypes.ts | 1 + src/helpers/meili.ts | 1 + src/syncho.ts | 11 +++++++-- 4 files changed, 56 insertions(+), 2 deletions(-) diff --git a/src/core/graphql/generated.ts b/src/core/graphql/generated.ts index 8744359..c8e13f3 100644 --- a/src/core/graphql/generated.ts +++ b/src/core/graphql/generated.ts @@ -1417,8 +1417,32 @@ export type ComponentTranslationsGlossaryDefinition = { definition?: Maybe; id: Scalars['ID']; language?: Maybe; + proofreaders?: Maybe; source_language?: Maybe; status: Enum_Componenttranslationsglossarydefinition_Status; + transcribers?: Maybe; + translators?: Maybe; +}; + + +export type ComponentTranslationsGlossaryDefinitionProofreadersArgs = { + filters?: InputMaybe; + pagination?: InputMaybe; + sort?: InputMaybe>>; +}; + + +export type ComponentTranslationsGlossaryDefinitionTranscribersArgs = { + filters?: InputMaybe; + pagination?: InputMaybe; + sort?: InputMaybe>>; +}; + + +export type ComponentTranslationsGlossaryDefinitionTranslatorsArgs = { + filters?: InputMaybe; + pagination?: InputMaybe; + sort?: InputMaybe>>; }; export type ComponentTranslationsGlossaryDefinitionFiltersInput = { @@ -1427,16 +1451,22 @@ export type ComponentTranslationsGlossaryDefinitionFiltersInput = { language?: InputMaybe; not?: InputMaybe; or?: InputMaybe>>; + proofreaders?: InputMaybe; source_language?: InputMaybe; status?: InputMaybe; + transcribers?: InputMaybe; + translators?: InputMaybe; }; export type ComponentTranslationsGlossaryDefinitionInput = { definition?: InputMaybe; id?: InputMaybe; language?: InputMaybe; + proofreaders?: InputMaybe>>; source_language?: InputMaybe; status?: InputMaybe; + transcribers?: InputMaybe>>; + translators?: InputMaybe>>; }; export type ComponentTranslationsGlossaryItem = { @@ -2758,6 +2788,7 @@ export type LibraryItem = { createdAt?: Maybe; descriptions?: Maybe>>; digital: Scalars['Boolean']; + download_available: Scalars['Boolean']; gallery?: Maybe; images?: Maybe>>; metadata?: Maybe>>; @@ -2864,6 +2895,7 @@ export type LibraryItemFiltersInput = { createdAt?: InputMaybe; descriptions?: InputMaybe; digital?: InputMaybe; + download_available?: InputMaybe; id?: InputMaybe; images?: InputMaybe; not?: InputMaybe; @@ -2888,6 +2920,7 @@ export type LibraryItemInput = { contents?: InputMaybe>>; descriptions?: InputMaybe>>; digital?: InputMaybe; + download_available?: InputMaybe; gallery?: InputMaybe>>; images?: InputMaybe>>; metadata?: InputMaybe>; @@ -5423,6 +5456,7 @@ export type WebsiteInterface = { display_all_items?: Maybe; done?: Maybe; double_page_view?: Maybe; + download_scans?: Maybe; draft?: Maybe; email?: Maybe; email_gdpr_notice?: Maybe; @@ -5480,6 +5514,8 @@ export type WebsiteInterface = { page_order?: Maybe; paper_texture?: Maybe; paperback?: Maybe; + performance_mode?: Maybe; + performance_mode_tooltip?: Maybe; player_name?: Maybe; player_name_tooltip?: Maybe; previous_content?: Maybe; @@ -5504,6 +5540,7 @@ export type WebsiteInterface = { scanlation?: Maybe; scanners?: Maybe; search?: Maybe; + search_placeholder?: Maybe; search_title?: Maybe; secondary_language?: Maybe; select_language?: Maybe; @@ -5629,6 +5666,7 @@ export type WebsiteInterfaceFiltersInput = { display_all_items?: InputMaybe; done?: InputMaybe; double_page_view?: InputMaybe; + download_scans?: InputMaybe; draft?: InputMaybe; email?: InputMaybe; email_gdpr_notice?: InputMaybe; @@ -5689,6 +5727,8 @@ export type WebsiteInterfaceFiltersInput = { page_order?: InputMaybe; paper_texture?: InputMaybe; paperback?: InputMaybe; + performance_mode?: InputMaybe; + performance_mode_tooltip?: InputMaybe; player_name?: InputMaybe; player_name_tooltip?: InputMaybe; previous_content?: InputMaybe; @@ -5713,6 +5753,7 @@ export type WebsiteInterfaceFiltersInput = { scanlation?: InputMaybe; scanners?: InputMaybe; search?: InputMaybe; + search_placeholder?: InputMaybe; search_title?: InputMaybe; secondary_language?: InputMaybe; select_language?: InputMaybe; @@ -5819,6 +5860,7 @@ export type WebsiteInterfaceInput = { display_all_items?: InputMaybe; done?: InputMaybe; double_page_view?: InputMaybe; + download_scans?: InputMaybe; draft?: InputMaybe; email?: InputMaybe; email_gdpr_notice?: InputMaybe; @@ -5876,6 +5918,8 @@ export type WebsiteInterfaceInput = { page_order?: InputMaybe; paper_texture?: InputMaybe; paperback?: InputMaybe; + performance_mode?: InputMaybe; + performance_mode_tooltip?: InputMaybe; player_name?: InputMaybe; player_name_tooltip?: InputMaybe; previous_content?: InputMaybe; @@ -5900,6 +5944,7 @@ export type WebsiteInterfaceInput = { scanlation?: InputMaybe; scanners?: InputMaybe; search?: InputMaybe; + search_placeholder?: InputMaybe; search_title?: InputMaybe; secondary_language?: InputMaybe; select_language?: InputMaybe; diff --git a/src/core/graphql/meiliTypes.ts b/src/core/graphql/meiliTypes.ts index 2796e27..5de4d9e 100644 --- a/src/core/graphql/meiliTypes.ts +++ b/src/core/graphql/meiliTypes.ts @@ -18,6 +18,7 @@ export interface MeiliLibraryItem extends LibraryItemAttributesFragment { sortable_name: string; sortable_price: number | undefined; sortable_date: number | undefined; + groupable_year: number | undefined; filterable_categories: string[]; untangible_group_item: boolean; } diff --git a/src/helpers/meili.ts b/src/helpers/meili.ts index 89f55b8..c157c4a 100644 --- a/src/helpers/meili.ts +++ b/src/helpers/meili.ts @@ -67,6 +67,7 @@ const transformLibraryItem: TransformFunction = (data const { id, attributes } = data; return { id, + groupable_year: attributes.release_date?.year ?? undefined, sortable_date: isDefined(attributes.release_date) ? getUnixTime(datePickerToDate(attributes.release_date)) : undefined, diff --git a/src/syncho.ts b/src/syncho.ts index ddd013e..187243a 100644 --- a/src/syncho.ts +++ b/src/syncho.ts @@ -17,8 +17,15 @@ export const synchronizeStrapiAndMeili = async (): Promise => { strapiToMeiliTransformFunctions.libraryItem(item) ), ["title", "subtitle", "descriptions"], - ["sortable_name", "sortable_date", "sortable_price"], - ["primary", "root_item", "id", "untangible_group_item", "filterable_categories"] + ["sortable_name", "sortable_date", "sortable_price", "groupable_year"], + [ + "primary", + "root_item", + "id", + "untangible_group_item", + "filterable_categories", + "groupable_year", + ] ); // [ CONTENT ]