update ingesstion chapters

This commit is contained in:
salahangal 2025-11-19 09:41:40 +01:00
parent 4a14036b01
commit e60e5decdd
3 changed files with 5 additions and 5 deletions

View File

@ -9,7 +9,7 @@ spec:
arguments: arguments:
parameters: parameters:
- name: book-slug - name: book-slug
value: "sahih-bukhari" value: "al-tirmidhi"
- name: limit - name: limit
value: "0" # 0 means no limit value: "0" # 0 means no limit

View File

@ -9,9 +9,9 @@ echo "=== Starting Full HadithAPI Ingestion ==="
# Books to ingest (in order) # Books to ingest (in order)
BOOKS=( BOOKS=(
# "sahih-bukhari" # "sahih-bukhari"
"sahih-muslim" # "sahih-muslim"
# "abu-dawood" # "abu-dawood"
# "al-tirmidhi" "al-tirmidhi"
# "ibn-e-majah" # "ibn-e-majah"
# "sunan-nasai" # "sunan-nasai"
# "musnad-ahmad" # "musnad-ahmad"

View File

@ -265,12 +265,12 @@ class HadithAPIClient(BaseAPIClient):
# Process each chapter # Process each chapter
for chapter in chapters: for chapter in chapters:
# logger.warning("Processing chapter", chapter=chapter) # logger.warning("Processing chapter", chapter=chapter)
if book_slug == 'sahih-muslim': if book_slug in {'sahih-muslim','al-tirmidhi','al-silsila-sahiha','al-tirmidhi'}:
chapter_id = chapter.get('chapterNumber') chapter_id = chapter.get('chapterNumber')
else: else:
chapter_id = chapter.get('id') chapter_id = chapter.get('id')
chapter_number = chapter.get('chapterNumber') chapter_number = chapter.get('chapterNumber')
print(chapter_id, chapter_number, chapter.get('name'))
logger.info( logger.info(
"fetching_chapter", "fetching_chapter",
book_slug=book_slug, book_slug=book_slug,