Re: Add pre-scan task?

Michael Herger <slim-b/[email protected]> Thu, 24 Mar 2022 11:17:32 +0100
Newsgroups gmane.music.equipment.slimdevices.devel
Message-ID <[email protected]>
> You can have importers run -post--scan tasks. Is there a *pre*-scan
> equivalent to that?

Not exactly. What there is is the "initPlugin()" sub in the importer 
which is being called during initialization. You could use this to run 
some preparation work. With "if (main::SCANNER)" you can check whether 
this is run inside the server (which should not happen) or the scanner.

I'm not 100% but "postInitPlugin()" might work in importers, too. In 
case you wanted to be sure all plugins were initialized before you run 
your code.

> One example I can think of: if the user decides to rescan, a plugin
> could ask LMS to create a backup of the plugin data first before
> starting the scan process.

That should work just fine using the above method.