-
Notifications
You must be signed in to change notification settings - Fork 322
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
[omm] Hash api implementation first draft #1355
Conversation
# the devcontainer and getting an error, just override the env | ||
app.config.from_pyfile("/workspace/.devcontainer/omm_config.py") | ||
else: | ||
raise RuntimeError("No flask config given - try populating OMM_CONFIG env") |
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.
Why was this needed?
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.
I tried running the flask CLI just to get a feel for it, and my run had an error, and I spent ~10 minutes learning this env variable needed to be populated, which I then realized for development will always just be this same value.
I changed the default for CLI is throw exception to default load this config.
@@ -10,18 +26,65 @@ def hash_media(): | |||
Fetch content and return its hash. | |||
TODO: implement | |||
""" | |||
|
|||
content_type = _parse_request_content_type() |
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.
How about we get the content type from the response headers (below) and simplify the interface?
download_resp.headers['content-type']
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.
Works for me - sometimes the content type cannot be determine from the URL, should we provide an optional param in that case?
Discussed offline, doing content detection in a followup and removing as an argument for now. |
Summary
Use the storage interfaces to pull the currently configured SignalType / ContentTypes, then download the content from the given URL and then process it.
Test Plan
Response: