bruvellu / cifonauta

Marine biology image database by CEBIMar/USP
http://cifonauta.cebimar.usp.br
GNU General Public License v3.0
21 stars 5 forks source link

Standardize file fields in Media models #276

Closed bruvellu closed 6 months ago

bruvellu commented 7 months ago

The names of the file-related fields are confusing: file, sitepath, coverpath, filepath (old). Their upload_to directories are also different. This has led to some difficult to catch behaviors. Files being uploaded or saved to different directories, or the metadata update being applied to different files (leaving others untouched).

The first step to clear this out is to define clearly the model fields. I'm torn between more descriptive names (but longer), or simpler short names:

Current Proposed Name Image Video Comment
file file original any/any any/any Any format or width within the file size limits.
- file_large large JPG/2000px/q90 MP4/1920px(1080p)/2000k Default formats at a large size
sitepath file_medium medium JPG/1000px/q70 MP4/1280px(720p)/1000k Default formats at a medium size
- file_small small JPG/500px/q70 MP4/640px(480p)/600k Default formats at a small size
coverpath file_cover cover JPG/750px/q70 - Snapshot for poster images
filepath oldpath - - - Old file paths, needed for later

See list of common resolutions.

bruvellu commented 6 months ago

Done 1b2726a9c5b6a7ec391bacef8d0e71038268c642