Re: SimpleLibraryViews plugin update increases library build time by a factor of 10

adhawkins <adhawkins.aktlio-NUepA2SMhDQqspMVqqL2D+4xXEVPTSb/[email protected]> Sun, 22 May 2022 09:45:20 +0000
Newsgroups gmane.music.equipment.slimdevices.devel
Organization Logitech Squeezebox Forums
Message-ID <[email protected]>
mherger wrote: 
> Yeah, that's trickier. Hmm... You'd probably have to use a different SQL
> query using REGEXP instead of LIKE for non-recursive. Then create a
> regex which would match the path, but no more slash after that.
> 
> > 
Code:
--------------------
  >   > 
  > if ($nonRecursive) {
  > $pathSearch = '^\Q' . Slim::Utils::Misc::fileURLFromPath($dir) . '/\E[^\/]*';
  > }
  > 
--------------------
> > 
> 
> Again: I haven't tested this. I'm not sure it would work. Please give
> it a try. I'd have to check what regexes SQL supports.

Looks like the DBD::SQLite module registers a 'regexp' function that
just uses Perl regexps. So as long as that is a valid Perl RE it should
be Ok.

Was going to try it in the command line client, but looks like that
might not work. A bit of googling suggested there was an extension to
sqlite that handled Perl REs, so will have a look at that.

Thanks as ever.

Andy


------------------------------------------------------------------------
adhawkins's Profile: http://forums.slimdevices.com/member.php?userid=650
View this thread: http://forums.slimdevices.com/showthread.php?t=116400