From e4c94ac85a9ba5a74b63e193c28a1ff3485eacc4 Mon Sep 17 00:00:00 2001 From: kisfenyo Date: Mon, 26 Jan 2026 08:00:39 +0100 Subject: [PATCH] fixed release date --- calibre-system/cwa.yaml | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/calibre-system/cwa.yaml b/calibre-system/cwa.yaml index f776830..f391b6b 100644 --- a/calibre-system/cwa.yaml +++ b/calibre-system/cwa.yaml @@ -309,6 +309,7 @@ data: return None def _parse_published_date(self, root) -> Optional[str]: + """Parse publication date - return as YYYY-01-01 format""" publication_node_1 = root.xpath('//*[@id="content"]//*[@class="items"]/div/div[1]/text()') if not publication_node_1: publication_node = root.xpath('//*[@id="content"]//*[@class="items"]/div/div[2]/text()') @@ -318,7 +319,8 @@ data: for value in publication_node: m = re.search(r'(\d{4})', value) if m: - return m.group(1) + # Return as full date (January 1st of that year) + return f"{m.group(1)}-01-01" return None def _parse_rating(self, root) -> int: @@ -623,7 +625,10 @@ data: # Publication date pub_year = book_props.get('Kiadás éve', '').strip() if pub_year: - match.publishedDate = pub_year + # Extract just the year and format as full date + year_match = re.search(r'(\d{4})', pub_year) + if year_match: + match.publishedDate = f"{year_match.group(1)}-01-01" # Series series = book_props.get('Sorozat', '').strip() @@ -787,7 +792,6 @@ data: } return lang_map.get(lang.lower(), 'hu') --- -# Calibre-Web-Automated Deployment apiVersion: apps/v1 kind: Deployment metadata: