Minimum sorting on "Media Source"

It would be great to be able to sort the “Local Media”.
My case is: I have actions that record the image of cameras, when looking at these videos/data they are named with timestamps to be sequential.

The issue is, that the latest recorded videos are at the end of the list, which leads to a lot of scrolling before getting into the relevant videos. Reversing the sorting would be of use here, I could track the code down to here:

which I believe is where the sorting is happening, but I can’t connect the dots to where the code to a toggle in the UI would be.

Even better would be the ability to look at this as a “table” (“ls -lt”) but that would be to much to ask!

I have the exact same issue.

Would love to have at least a few sorting options which could be set for each folder by default. I don’t think we are the only ones who use timestamps for surveillance videos and I would love to see latest first.

1 Like

I have the same problem. Did you guys found a solution yet?

It’s quite simply by adding just reverse=True, like:

media.children.sort(key=lambda child: (child.can_play, child.title), reverse=True)

In my HAOS system the path is:

/usr/src/homeassistant/homeassistant/components/media_source/local_source.py

Of course it will not survive updating HA

Hello, how to sort by date? please tell me. I don’t understand why there is no sorting option from the interface