Skip to content

Commit b2f2942

Browse files
fix: correct CSV parsing to include TR and EN slugs in lists
1 parent cefc5ee commit b2f2942

File tree

1 file changed

+8
-2
lines changed
  • be-scraper-fastapi/app/services/unify

1 file changed

+8
-2
lines changed

be-scraper-fastapi/app/services/unify/lists.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,9 @@
88
# Initialize lists
99
ar_names_list = []
1010
tr_names_list = []
11+
tr_slugs_list = []
1112
en_names_list = []
13+
en_slugs_list = []
1214
tr_links_list = []
1315
en_links_list = []
1416
min_members_list = []
@@ -21,8 +23,10 @@
2123
with open(csv_file_path, 'r', encoding='utf-8') as f:
2224
csv_reader = csv.DictReader(f)
2325
for row in csv_reader:
24-
tr_link = row.get('tr_slug', '').strip()
25-
en_link = row.get('en_slug', '').strip()
26+
tr_link = row.get('tr_link', '').strip()
27+
tr_slug = row.get('tr_slug', '').strip()
28+
en_link = row.get('en_link', '').strip()
29+
en_slug = row.get('en_slug', '').strip()
2630
ar_name = row.get('ar_name', '').strip()
2731
tr_name = row.get('tr_name', '').strip()
2832
en_name = row.get('en_name', '').strip()
@@ -34,7 +38,9 @@
3438
# Only add if we have at least TR and EN links
3539
if tr_link and en_link:
3640
tr_links_list.append(tr_link)
41+
tr_slugs_list.append(tr_slug)
3742
en_links_list.append(en_link)
43+
en_slugs_list.append(en_slug)
3844
ar_names_list.append(ar_name)
3945
tr_names_list.append(tr_name)
4046
en_names_list.append(en_name)

0 commit comments

Comments
 (0)