Skip to content
This repository has been archived by the owner on Jun 10, 2024. It is now read-only.

Fix bug when local file from LS is not found #79

Merged
merged 1 commit into from
Jun 4, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions label_studio_tools/core/utils/io.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,9 @@ def get_local_path(
filepath = os.path.join(image_dir, project_id, os.path.basename(url))
if cache_dir and download_resources:
shutil.copy(filepath, cache_dir)
logger.debug(f"Uploaded file: Path exists in image_dir: {filepath}")
return filepath
if os.path.exists(filepath):
logger.debug(f"Uploaded file: Path exists in image_dir: {filepath}")
return filepath

# Upload or Local Storage file
if is_uploaded_file or is_local_storage_file or is_cloud_storage_file:
Expand Down
Loading