diff --git a/owilix/core/lexis.py b/owilix/core/lexis.py index ac3adf1..d0204fb 100644 --- a/owilix/core/lexis.py +++ b/owilix/core/lexis.py @@ -121,11 +121,11 @@ class OWILexisDatasetAPI(Datasets): else: url = url + f"?dataset_type={dataset_type}" - if project is not None: - if "=" in url: - url = url + f"&project={project}" - else: - url = url + f"?project={project}" + #if project is not None: + # if "=" in url: + # url = url + f"&project={project}" + # else: + # url = url + f"?project={project}" if access is not None: if "=" in url: @@ -145,6 +145,8 @@ class OWILexisDatasetAPI(Datasets): json_data={"fields":{}}, to_json=True) + + content_length: int = content.get("total", None) records: list[dict] = content.get("datasets", None) @@ -168,6 +170,9 @@ class OWILexisDatasetAPI(Datasets): else: is_all = True + if project is not None: + all_records = [a for a in all_records if a.get("project_shortname","") == project] + if content_as_pandas: all_records: DataFrame = convert_list_of_dicts_to_pandas(session=self.__session, content=all_records,