mirror of
https://github.com/gradio-app/gradio.git
synced 2025-04-12 12:40:29 +08:00
Add orig_name field to video outputs (#3700)
* Add orig_name to video * Fix test * CHANGELOG * Lint
This commit is contained in:
parent
1229f3b001
commit
f97b5c0c72
@ -58,7 +58,7 @@ No changes to highlight.
|
||||
- Copy everything in website Dockerfile, fix build issues by [@aliabd](https://github.com/aliabd) in [PR 3659](https://github.com/gradio-app/gradio/pull/3659)
|
||||
- Raise error when an event is queued but the queue is not configured by [@freddyaboulton](https://github.com/freddyaboulton) in [PR 3640](https://github.com/gradio-app/gradio/pull/3640)
|
||||
- Allows users to apss in a string name for a built-in theme, by [@abidlabs](https://github.com/abidlabs) in [PR 3641](https://github.com/gradio-app/gradio/pull/3641)
|
||||
|
||||
- Added `orig_name` to Video output in the backend so that the front end can set the right name for downloaded video files by [@freddyaboulton](https://github.com/freddyaboulton) in [PR 3700](https://github.com/gradio-app/gradio/pull/3700)
|
||||
|
||||
## Contributors Shoutout:
|
||||
|
||||
|
@ -2138,7 +2138,7 @@ class Video(
|
||||
y = output_file_name
|
||||
|
||||
y = self.make_temp_copy_if_needed(y)
|
||||
return {"name": y, "data": None, "is_file": True}
|
||||
return {"name": y, "data": None, "is_file": True, "orig_name": Path(y).name}
|
||||
|
||||
def style(self, *, height: int | None = None, width: int | None = None, **kwargs):
|
||||
"""
|
||||
|
@ -1292,6 +1292,7 @@ class TestVideo:
|
||||
assert output1.endswith("mp4")
|
||||
output2 = video_output.postprocess(y_vid_path)["name"]
|
||||
assert output1 == output2
|
||||
assert video_output.postprocess(y_vid_path)["orig_name"] == "video_sample.mp4"
|
||||
|
||||
assert video_output.deserialize(
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user