`serve dlna` files order (directories first)

I use rclone serve dlna with WebDav backend. It works fine, but LG TV blindly shows the files in the order the DLNA server supplies, particularly directories are mixed with files. Is it somehow possible to apply a custom sort (directories first) to backend or dlna serve? I guess, another option is to sort on the WebDav server, but this likely requires code change as well.

welcome to the forum,

just throwing out an idea, not perfect. but would not require rclone source code changes.
might be able to implement on your own, now.

  1. using rclone to create a list of directories and files named list.txt
  2. write a script to sort list.txt
  3. rclone serve dlna --files-from=list.txt

@ksa please give this a try

v1.69.0-beta.8308.b4ef890aa.fix-dlna-sort on branch fix-dlna-sort (uploaded in 15-30 mins)

It sorts the directory entries by folder first, then by name

Did that beta work for you @ksa?