Skip to content

Commit

Permalink
Patch up bad code introduced by style changes #171 (#183)
Browse files Browse the repository at this point in the history
  • Loading branch information
stucka authored Dec 27, 2024
1 parent 975097e commit 51bb732
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions clean/platforms/nextrequest.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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",
Expand Down Expand Up @@ -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

0 comments on commit 51bb732

Please sign in to comment.