@mherger: Point taken, but I have to register the libraries sometime,
and I figured the best way to do this was after the settings had
changed. If I don't do that, then the scanner won't know about the new
libraries will it?

Yes, that's fine. But you shouldn't need to run the library creation from there. Trigger a scan instead. Or add this line in your loop:

        main::idle() unless main::SCANNER;

This would at least allow the server to continue streaming to the players. Feel free to only do this once every 50 tracks or the like. Just don't stall execution of the server for more than a fraction of a second (yes, LMS is not multi-threaded).

The main::SCANNER condition makes sure this isn't run when called within the scanner, because the scanner doesn't have an event loop.

And one other (more complicated) option would be to use Slim::Utils::Scheduler to process the whole thing in smaller, manageable chunks. But I'd rather just trigger a scan...

--

Michael
_______________________________________________
plugins mailing list
plugins@lists.slimdevices.com
http://lists.slimdevices.com/mailman/listinfo/plugins

Reply via email to