Closed chrisrpi closed 2 years ago
Yes, unfortunately this is a limitation of the media source (which I assume you're using). It returns the file names but not the actual created date, so the files get sorted only by name. In your case that is sorting time before the date, which is not ideal.
You only really have two options at the moment:
If home assistant ever provides more file metadata in a media source I will update the card to better sort.
Ah...that makes perfect sense now.
Thank you for such a fast response, I shall make the change in Node Red as suggested.
Thank you!
First thanks a lot for your great card ! As you can only get the filenames from HA medias, I wondered if it would be possible to use the data from the "file_name_format" to sort the media files by date ?
First thanks a lot for your great card ! As you can only get the filenames from HA medias, I wondered if it would be possible to use the data from the "file_name_format" to sort the media files by date ?
That never occurred to me for some reason, but good idea!
I'll add to my backlog to add an option something like "sort by formatted name"
thank you very much :-)
This should be possible in v3.3 just released by switching on the parsed_date_sort option. Thanks to @kalhimeo for the assist.
HI ... fantastic card...many thanks.
On the second day of using it (to show movement snapshots from my camera) I noticed that today's pics are shown at the bottom of the list. I have the reverse sort box ticked.
Although the newest day is shown at the bottom, within a given day, the pics are sorted correctly with the newest time first.
If I look at the pics in media browser, they are listed in newest date/oldest time order. The same happens in file editor. The pic names are generated in node red and are datestamped as follows ... {"filename":"/media/snapshot_{{now().strftime('%H:%M %d-%m-%Y')}}.jpg"} ... can't imagine this affects how they are listed?
Not sure if this is an issue with how I have home assistant set up or if it is a card issue?
Would be very grateful for any advice.
Many thanks indeed, Chris.