BUG: Length of audio files displayed in a non-human-friendly way
Describe the bug The metadata section of audio files displays the length of a recording in seconds with 3 decimal points in accuracy. While this is correct information, it's not very readable and might create confusion.
To Reproduce Steps to reproduce the behavior:
- Upload an adio recording, for example an mp3 file
- Wait until the file is processed
- Look at metadata section
Expected behavior It would be easier to understand if the length was displayed in hh:mm:ss or a similar format.
Aleph version 3.15.1rc1
Screenshots
Just a note here...
I agree that the duration should be human readable, but we need to be mindful of the duration and how this impacts what should be displayed to the user. Thus:
- if the duration in less than 1 second we should display as ms
- from 1 second to 59 seconds display should be seconds + milliseconds
- from 1 minute to 1 hour display should be minutes + seconds
- from 1 hour to 1 day display should be hour + minutes
It's unlikely that we'll have audio/video that is greater in length that 24hrs or less than 1 second. But we should adjust the display appropriately.
Just some notes for future reference: To implement this in a generic way we’d probably need to introduce a new FtM property type for durations. Right now, properties like Audio:duration use the number property type. This would then allow us to customize how properties of this type are rendered in the Aleph UI.
Related: This is what the search facet for number (and unless otherwise implemented for new duration) properties looks like. Might make sense to tackle that at the same time and implement a range slider or something like that.