Skip to content

API stuff #2

@eric-unc

Description

@eric-unc

Currently testing calling the api locally. There seems to be the following things that need to be done still on the backend:

  • send_file I think needs to be imported from flask, I am getting a NameError.
  • each api call needs to return something, probably a JSON string, to indicate that the request was successful. Otherwise, on my end, I'm getting status code 500s (that's an error), even though it seems like post-file in the very least definitely works.
  • we need to allow more than one person to be able to upload a file at once, or in the very least, we need to put proper restrictions so that trying to upload a file when the server is already working on a file will reject the call.
  • the key name should specify the file identifier of the resulting file (so {name}.mid instead of result.mid).
  • zip support (I'm not actually sure if it's supported or not?)
  • lower priority: we need to make begin_transfer call lstm.py, predict.py in a less hacky way. Currently I don't have all of the dependencies installed, so when these scripts are run, they won't work, but because it's using os.system no errors are returned. I don't know how Python modularization works but it should be looked into.
  • lowest priority: on lines 40-41 currently we use os.system to call to unzip the files and to remove the zip files. Using os.system here is platform-dependent (rm -rf won't function on Windows) which is generally bad, there are definitely file utilities built into Python that we could use instead.

Metadata

Metadata

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions