-
Notifications
You must be signed in to change notification settings - Fork 74
Description
Observed behavior
When requesting a file upload URL from Studio, Ricecooker does utilize the original file name, but that is eventually discarded, meaning the filename for cheffed files will default to file
the issue is that ricecooker's implementation of the file upload URL stuff [...] creates the file object to get the upload URL, but then an entirely new file object gets created during the channel upload, so that data gets discarded.
Expected behavior
Ricecooker should use preserve the filename
User-facing consequences
These files end up showing Unknown filename to the end user.
Context
Looking at the following bit of code it does appear Ricecooker passes the filename along in its initial request for an upload URL, but according to the above quote, that gets discarded
ricecooker/ricecooker/managers/tree.py
Lines 155 to 166 in b694f3d
| "name": file_data.original_filename or file_data.get_filename(), | |
| "file_format": file_data.extension, | |
| "preset": file_data.get_preset(), | |
| "duration": file_data.duration, | |
| } | |
| # Workaround for a bug in the Studio upload URL endpoint, whereby | |
| # it does not currently use the passed in file_format as the default | |
| # extension. | |
| name, ext = os.path.splitext(data["name"]) | |
| if not ext: | |
| data["name"] = "{}.{}".format(name, data["file_format"]) | |
| url_response = config.SESSION.post(config.get_upload_url(), json=data) |