mediacms-io / mediacms

MediaCMS is a modern, fully featured open source video and media CMS, written in Python/Django and React, featuring a REST API.
https://mediacms.io
GNU Affero General Public License v3.0
2.52k stars 459 forks source link

Filename extension missing on downloaded assets #903

Open ministry-of-code opened 8 months ago

ministry-of-code commented 8 months ago

Describe the issue When uploading media, assets are correctly being transcoded and offered for download. However, downloaded files do not have a file extension. To be recognised by other programs the proper extension has to be added manually.

To Reproduce I have uploaded an mp4 asset to the demo server here: https://demo.mediacms.io/view?m=qi8r3Gbg8

Navigate to the asset above, open the download popup and download the artifact with 480p resolution. The downloaded file will have the name signal-2023-08-08-111953_002.mp4_480_H264

Expected behavior I expect the filename to be like signal-2023-08-08-111953_002.mp4_480_H264.mp4 or signal-2023-08-08-111953_002_480_H264.mp4 - with the proper extension mp4.

Environment

ministry-of-code commented 8 months ago

It appears like the issue only occurs if the asset title ends with a filename extension (e.g. .mp4). Since the title is set to the upload file name (including the extension) by default, download file names are broken if this original title is being kept unchanged. When removing the extension from the title and then downloading the "original file" then the extension on that original file is gone ...

m-kind commented 3 months ago

If I have understood correctly, only the title of the asset is used as the download file name and no explicit file extension is attached. Can this be fixed without much effort? We might be interested in throwing in coins for this.