Page 1 of 1
Bug with LIKE?
Posted: Fri Oct 25, 2013 8:43 am
by trixmoto
My "ImportM3U" script works by checking the path of tracks in the library against the paths in an M3U file. For example, this...
Code: Select all
SELECT Songs.ID FROM Songs WHERE Songs.SongPath LIKE '%\10%The%Blues%Brothers%B%Movie%Box%Car%Blues%'
...which should match with the path "
:\Music\The Blues Brothers\Briefcase Full Of Blues (1995)\10_The Blues Brothers_'B' Movie Box Car Blues.mp3". This definitely used to work, but for some reason, it no longer is in the latest version (and maybe a few versions now). However, if I run this command...
Code: Select all
SELECT Songs.ID FROM Songs WHERE Songs.SongPath LIKE '%Blues%'
...then it does find this track. It looks like you can only have two "%" characters in a LIKE!?
Re: Bug with LIKE?
Posted: Fri Oct 25, 2013 9:13 am
by jiri
The currently Like implementation hasn't been changed for quite a long time and yes, it's a little limited. We don't plan to change it atm, but MMW5 (rather early in the development atm) will probably support regular expressions, i.e. will be much more powerful.
Jiri
Re: Bug with LIKE?
Posted: Fri Oct 25, 2013 4:48 pm
by Mizery_Made
jiri wrote:MMW5 (rather early in the development atm)
Re: Bug with LIKE?
Posted: Sat Oct 26, 2013 1:17 am
by trixmoto
But this definitely used to work, this script would never have worked without that, nor would my RecreateM3U, or quite a few of my other scripts!
Re: Bug with LIKE?
Posted: Sat Oct 26, 2013 2:30 am
by trixmoto
I'm working around this issue now with syntax like this...
Code: Select all
SELECT Songs.ID FROM Songs WHERE Songs.SongPath LIKE '%10%' AND Songs.SongPath LIKE '%The%' AND Songs.SongPath LIKE '%Blues%' AND Songs.SongPath LIKE '%Brothers%' AND Songs.SongPath LIKE '%B%' AND Songs.SongPath LIKE '%Movie%' AND Songs.SongPath LIKE '%Box%' AND Songs.SongPath LIKE '%Car%' AND Songs.SongPath LIKE '%Blues%'
It seems to work ok, although obviously the logic is a little different now, as the order of the parts is no longer correct.
Re: Bug with LIKE?
Posted: Sat Oct 26, 2013 3:58 am
by ZvezdanD