Thought I would raise this for discussion before submitting any of my modified code.
I use caddy to serve media to my KODI instance over the internet, and I need to use a special template to allow KODI to understand the file listing (this is needed because the KODI http scraping code is specialised to apache, nginx, and lighttpd directory indexes). I wrote a template the works around this by mimicking the nginx (simplest) listing.
My solution was very specific and I basically copied the default template and added an if user-agent is kodi block around the whole thing, rendering either the default listing or a super simple kodi-understandable version as needed. It works fine.
My question is:
Given that some software behaves this way do you think it would be beneficial to the browse plugin to have some extra builtin templates that mimic well known other indexes?
Or if not, would the Caddy project be better off if the browse plugin recognized a KODI UA specifically and adapted it’s template accordingly?
The first seems more general, the second would mean KODI specifically would work out of the box.
Could you post your template? I am having this issue as well, I’ve tried to make a template mimicking Apaches directory listings, but I can’t get Kodi to enter directories with spaces in the name.
As far as I can tell the issue I’m running into is that .URL in the FileInfo object starts with a “./” which Kodi doesn’t like. But I can’t figure out how to get rid of that, or how to swap the spaces in .Name with “%20”.