Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

atlas_media not returning results #145

Closed
mjwestgate opened this issue Jun 15, 2022 · 1 comment
Closed

atlas_media not returning results #145

mjwestgate opened this issue Jun 15, 2022 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@mjwestgate
Copy link
Collaborator

When I try quite simple queries with atlas_media, they often fail. For example, to get images for this record, I get:

atlas_media(
  filter = galah_filter(id == "ead2f896-4c07-4e5e-9dc4-be5c9ee7643f"), 
  download_dir = "cache")
  |========================================================================| 100%
Calling the API failed for `atlas_media`.
ℹ This might mean that the ALA system is down. Double check that your query is correct.
ℹ If you continue to see this message, please email support@ala.org.au.
# A tibble: 0 × 0

On further investigation, it appears there are (at least) two problems:

  • This function uses the imageInfoForList API (docs here) to query many image identifiers at once, but doesn't appear to work
  • It also uses curl::Async to make the query, but this errors for unknown reasons (Error in AsyncVaried$new(.list = reqs) : object 'reqs' not found)

Both problems can be solved by choosing simpler solutions and looping/lapply-ing across all identifiers. This approach has the advantage that the API supports downloading thumbnails by adding thumbnail to the url, perhaps via a type argument.

@mjwestgate mjwestgate added the bug Something isn't working label Jun 15, 2022
mjwestgate added a commit that referenced this issue Jun 15, 2022
- switch to simpler API call for images
- switch from `Async` to `HttpClient` for downloads
- add `type` argument to support thumbnail downloads
- remove `select` argument (not used)
- misc updates to ensure the above actually works
mjwestgate added a commit that referenced this issue Jun 15, 2022
@daxkellie daxkellie assigned mjwestgate and shandiya and unassigned mjwestgate Jul 4, 2022
@shandiya shandiya assigned mjwestgate and unassigned shandiya Jul 4, 2022
mjwestgate added a commit that referenced this issue Jul 21, 2022
`atlas_media` now returns a `tibble`, but does not download images; this allows use of e.g. `dplyr::filter` to reduce the number of images that will be returned (#140, #151)
- new function `collect_media` takes a tibble from `atlas_media` and downloads to the specified directory. Supports thumbnail downloads via `type` argument (#145)
- Alternatively, users can build their own media queries via `atlas_occurrences` and trigger a metadata download (equivalent to `atlas_media`) using `show_all_media`
@mjwestgate
Copy link
Collaborator Author

labelling this as fixed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants