ropensci / osfr

R interface to the Open Science Framework (OSF)
https://docs.ropensci.org/osfr
Other
143 stars 28 forks source link

Change .wb_download to use WB path ID #141

Closed psanker closed 2 years ago

psanker commented 2 years ago

Around March 2022, I discovered that the OSF API no longer accepts GUIDs for downloading files. Instead, the Waterbutler path must be used. This PR just swaps the fid parameter in .wb_download() to use as_wb_id(), a new generic that mirrors the as_id() pattern but instead uses get_meta(x, "attributes", "path").

aaronwolen commented 2 years ago

Thanks for taking the time to identify and fix this issue! The PR looks great. I'd love to add a couple tests but the OSF test server is currently down 😞. So I'll merge as is and will make a note to add tests in the future.