From 51bb73283e44cae75e850612f87ad7b0a36e68c7 Mon Sep 17 00:00:00 2001 From: Mike Stucka Date: Fri, 27 Dec 2024 16:05:06 -0500 Subject: [PATCH] Patch up bad code introduced by style changes #171 (#183) --- clean/platforms/nextrequest.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/clean/platforms/nextrequest.py b/clean/platforms/nextrequest.py index 4faede71..2c229449 100644 --- a/clean/platforms/nextrequest.py +++ b/clean/platforms/nextrequest.py @@ -279,16 +279,17 @@ def fingerprint_nextrequest(start_url: str): parsed_url = urlparse(start_url) if parsed_url.path == "/documents": # LAPDish type base_url = f"{parsed_url.scheme}://{parsed_url.netloc}" + folder_id = parse_qs(parsed_url.query)["folder_filter"][0] line = { "site_type": "lapdish", # LAPDish type "base_url": base_url, - "folder_id": parse_qs(parsed_url.query)["folder_filter"][0], + "folder_id": folder_id, "page_size": 50, "doc_limit": 9950, # Max number of accessible docs in a folder "tally_field": "total_count", "bln_page_url": "bln_page_url", "bln_total_documents": "bln_total_documents", - "json_url": f"{base_url}/client/documents?sort_field=count&sort_order=desc&page_size=50&folder_filter={line['folder_id']}&page_number=", # type: ignore + "json_url": f"{base_url}/client/documents?sort_field=count&sort_order=desc&page_size=50&folder_filter={folder_id}&page_number=", # type: ignore "details": { "document_path": "document_path", "description": "description", @@ -312,14 +313,15 @@ def fingerprint_nextrequest(start_url: str): and parsed_url.path.split("/")[1] == "requests" ): base_url = f"{parsed_url.scheme}://{parsed_url.netloc}" + folder_id = urlparse(start_url).path.split("/")[2] line = { "site_type": "bartish", # Bartish type "base_url": base_url, - "folder_id": urlparse(start_url).path.split("/")[2], + "folder_id": folder_id, "doc_limit": 9950, # Max number of accessible docs in a folder "page_size": 25, "tally_field": "total_documents_count", - "json_url": f"{base_url}/client/request_documents?request_id={line['folder_id']}&page_number=", # type: ignore + "json_url": f"{base_url}/client/request_documents?request_id={folder_id}&page_number=", # type: ignore "details": { "document_path": "ds!document_path", "bogus_asset_url": "asset_url", @@ -353,4 +355,4 @@ def fingerprint_nextrequest(start_url: str): def find_max_pages(item_count: int, page_size: int): - return ceil(item_count, page_size) # type: ignore + return ceil(page_size / item_count) # type: ignore