-
Notifications
You must be signed in to change notification settings - Fork 76
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
[SVCS-528] Look for mfr
query param from mfr in v1 provider
#290
Changes from all commits
705f866
8947b8f
99cc7d7
96a4eee
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -234,9 +234,18 @@ async def download(self, # type: ignore | |
|
||
metadata = await self.metadata(path, revision=revision) | ||
|
||
if kwargs.get('mfr', None) and kwargs['mfr'].lower() == 'true': | ||
download_url = drive_utils.get_alt_export_link(metadata.raw) # type: ignore | ||
export_name = metadata.alt_export_name | ||
else: | ||
|
||
# TODO figure out metadata.raw.get('downloadUrl') | ||
download_url = metadata.raw.get('downloadUrl') or drive_utils.get_export_link(metadata.raw) # type: ignore | ||
export_name = metadata.export_name # type: ignore | ||
|
||
download_resp = await self.make_request( | ||
'GET', | ||
metadata.raw.get('downloadUrl') or drive_utils.get_export_link(metadata.raw), # type: ignore | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. On |
||
download_url, | ||
range=range, | ||
expects=(200, 206), | ||
throws=exceptions.DownloadError, | ||
|
@@ -251,7 +260,7 @@ async def download(self, # type: ignore | |
if download_resp.headers.get('Content-Type'): | ||
# TODO: Add these properties to base class officially, instead of as one-off | ||
stream.content_type = download_resp.headers['Content-Type'] # type: ignore | ||
stream.name = metadata.export_name # type: ignore | ||
stream.name = export_name # type: ignore | ||
return stream | ||
|
||
async def upload(self, stream, path: wb_path.WaterButlerPath, *args, **kwargs) \ | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need to make this more specific (both method name and the test inside). What is this test trying to do?