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 458 forks source link

Uploaded media gets truncated title #981

Open maxcynicle opened 4 months ago

maxcynicle commented 4 months ago

Describe the issue I've self-hosted MediaCMS using the docker compose instructions and everything is fine and dandy. However, when I upload media, the media name on the platform gets truncated.

I have 2 videos, filenames are as follows: "002. 1.1 Exploring Linux" (25 characters) "003. 1.2 Understanding Red Hat Enterprise Linux" (48 characters)

Upon uploading, I find that the title of the first video is correctly captured whereas the title of the second video is now truncated as follows: image

Checking the django administration portal, I find the following: {"filename": "/home/mediacms.io/mediacms/media_files/original/user/cynix/50438b42560c4d5e90cce6f010470e96.002._1.1_Exploring_Linux.mp4", "file_size": 9549653, "video_duration": 160.852995, ... {"filename": "/home/mediacms.io/mediacms/media_files/original/user/cynix/67f4fc36e4a846ee8f2916510c30705d.00312U1.MP4", "file_size": 4370771, "video_duration": 73.452995, ...

If I proceed to rename the 2nd video, it will store the 48 characters with no errors.

To Reproduce Steps to reproduce the issue:

  1. Upload a video file with 48 characters in filename
  2. Observe it gets truncated
  3. Rename video on MediaCMS with same 48 characters
  4. Observe it saves fine

Expected behavior If the media being uploaded has a very long name, it should truncate to a certain string length, instead of using 8dot3 naming convention (I'm guessing it's 8dot3). I'm guessing what is happening here is that instead of retaining the name of the file that was uploaded, it takes the filename available on the storage upon upload success. I would expect there to be changes on the storage backend if the file stored is renamed to accommodate name length restrictions on the filesystem, but the UI should retain the name during upload to store it once it has completed upload successfully.

I have over a 100 videos and they're not extremely long filenames, but it'd be a pain if I have to rename more than 50% of the media files.

Environment (please complete the following information):

Additional context Please tell me if I'm doing something wrong or this has been explained in a setting somewhere before. I've searched on this repo for about 3 days and poked around the .py files and I couldn't find a solution.

Lastly, thank you for this great product!