Skip to content

Commit

Permalink
Update changelog, tidy up code.
Browse files Browse the repository at this point in the history
  • Loading branch information
ismailsunni committed Sep 12, 2024
1 parent cf907d0 commit 5dec1d1
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 6 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,14 @@ Unreleased
-->

## 0.2.0 - 2024-09-13

- Limit the name to be maximum 50 character
- Add filtering for 3D model and QGIS Layer Definition
- Add "add to QGIS" for layer definition
- Fix bug when resource give 404


## 0.1.2 - 2023-11-01

- Fix bug #85: failed to handle null thumbnail
Expand Down
2 changes: 1 addition & 1 deletion qgis_hub_plugin/core/api_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ def get_all_resources(force_update=False):
return json.load(f)

# TODO: download in the background
# hardcoded to get all resource, currently only ~160
# hardcoded to get all resource, currently only ~227
url = f"{BASE_URL}?limit=1000&format=json"
status = download_file(url=url, destination=response_file, force=force_update)
if status and response_file.exists():
Expand Down
7 changes: 2 additions & 5 deletions qgis_hub_plugin/utilities/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,6 @@ def get_icon_path(icon_name: str) -> str:
return os.path.join(DIR_PLUGIN_ROOT, "resources", "images", icon_name)


# def download_file(url: str, file_path: Path, force: bool = False):
# if not force and file_path.exists():
# return


def download_file(
url: str, destination: Path, force: bool = True, timeout: int = 30000
) -> Optional[str]:
Expand All @@ -37,6 +32,8 @@ def download_file(
Args:
url (str): The URL of the file to download.
destination (Path): The local path where the file should be saved.
force (bool): If true, the file will be downloaded even if it already exists.
Defaults to True.
timeout (int): The timeout for the request in milliseconds. Defaults to 30000 (30 seconds).
Returns:
Expand Down

0 comments on commit 5dec1d1

Please sign in to comment.