This repository was archived by the owner on Oct 14, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +15
-6
lines changed
Expand file tree Collapse file tree 1 file changed +15
-6
lines changed Original file line number Diff line number Diff line change @@ -408,17 +408,26 @@ get_metadata <- function(
408408# ' @importFrom RSQLite SQLite SQLITE_RO
409409# ' @importFrom dplyr tbl
410410# ' @importFrom httr progress
411+ # ' @importFrom cli cli_alert_info
411412# '
412413get_metadata_local <- function (
413- remote_url = " https://object-store.rc.nectar.org.au/v1/AUTH_06d6e008e3e642da99d806ba3ea629c5/metadata-sqlite/metadata.sqlite " ,
414+ remote_url = " https://object-store.rc.nectar.org.au/v1/AUTH_06d6e008e3e642da99d806ba3ea629c5/metadata-sqlite/metadata.tar.xz " ,
414415 cache_directory = get_default_cache_dir()
415416) {
417+ tar_path <- file.path(cache_directory , " metadata.tar.xz" )
416418 sqlite_path <- file.path(cache_directory , " metadata.sqlite" )
417- sync_remote_file(
418- remote_url ,
419- sqlite_path ,
420- progress(type = " down" , con = stderr())
421- )
419+ if (! file.exists(sqlite_path )){
420+ tar_dir <- tempdir()
421+ tar_file <- file.path(tar_dir , " metadata.tar.xz" )
422+ cli_alert_info(" Downloading tar archive" )
423+ sync_remote_file(
424+ remote_url ,
425+ tar_file ,
426+ progress(type = " down" , con = stderr())
427+ )
428+ cli_alert_info(" Decompressing tar archive" )
429+ untar(tar_file , exdir = cache_directory )
430+ }
422431 SQLite() | >
423432 dbConnect(drv = _, dbname = sqlite_path , flags = SQLITE_RO ) | >
424433 tbl(" metadata" )
You can’t perform that action at this time.
0 commit comments