Closed hhartzer closed 6 months ago
Looks like Kodi is using these regexes to parse the generated directory listing: https://github.com/xbmc/xbmc/pull/17652/files
Do you want to change the regexes, or the directory listing? :)
Nice find!
I feel like maybe changing the directory listing is better in this case. I'm thinking the regex is trickier. 😛
I'll dive in more and see which example is closest (maybe nginx?).
Looking at e.g. xbmc/filesystem/test/data/httpdirectory/apache-html.html, it's probably the mtime is missing like you said at the start.
I'd be okay with adding mtimes to the generated listing.
Looking at the regexes they use to parse the HTML (lol etc), I think we should generate something that matches ([0-9]{4})-([0-9]{2})-([0-9]{2}) ([0-9]{2}):([0-9]{2})
i.e. yyyy-mm-dd hh:mm
Sounds good! ISO-8601 seems like a great option here. Looks like not down to the seconds?
Should it respond in local time or UTC? I forgot which the Date header was doing.
Date:
is GMT, but I vote for local time for directory listings. Usually I'm using darkhttpd to copy files between machines that are in my own timezone.
If you don't want this behavior, you can always env TZ=UTC ./darkhttpd /path
Not a bug, but maybe something simple to address.
When Kodi uses darkhttpd as a HTTP source, it shows 0B for all file sizes.
This may be because the last modified date is missing. It may also be because we don't give a "-" under directory sizes.
I imagine there's some common libraries used for parsing this that could explain more.
Related: https://github.com/xbmc/xbmc/issues/17623