nmaier/simpleDLNA

Long startup time on a large directory

Opened this issue · 4 comments

Hi,

First of all thanks for implementing this, it seems to be exactly what I was looking for :-)

It works great when I run it on a small directory, however when I start it on a large one (~500 files/directories at 1st level of depth), it takes a very long time to start. Inspection with strace shows that it's scanning everything recursively. Why is it needed? Can it be disabled?

Certainly not what I understood when I read "just fire up in some directory, watch some files on my TV and then be done with it" ;-)

So, you want an option to only serve the directory, but not sub-directories?

Hi, thanks for your reply,

I was wondering if it would be possible to just serve the root directory at first, yeah, and then only descend into sub-directories when a DLNA client chooses one -- that is, when I click one of the sub-directories in the client.

None of the DLNA servers I've found so far seems to be operating like this, so I'm wondering if it's possible at all -- but it's the natural way of how it should work IMO.

it would be possible too lazily index subdirectories on demand, but it a bit of work to make it work correctly and does not really fit well within the concept of sdlna with its views (applying any transforming view would require to read everything anyway).

I don't have the time to implement or even prototype this right now, so I will leave this open for the future maybe or in case anybody wants to contribute the necessary code.

In the meantime, I wrote https://github.com/goblin/nanodlna :-)