PDA

View Full Version : Cannot search for mp3 comments



slutz
2007-05-30, 11:17
Hi,

I just installed the new 6.5.2 SlimServer release and now I am unable to search for mp3 comments but they are displayed. I already did a rebuild of the database but it did not help. In the code I saw that searching for lyrics is similar to looking for comments and searching lyrics works as expected. Searching for comments worked well with 6.5.1.

Does anybody see the same? Does anybody have an idea?

Update: I deleted the database. Did not help.

Thanks!
-slutz

slutz
2007-05-31, 00:00
Ok, as nobody answered. I will simplify:

Could anybody please confirm that searching for mp3 comments in 6.5.2 works or does not work.

Thanks,
-slutz

slutz
2007-05-31, 00:46
It does not work. Somebody changed "comments" to "comments_value".
This conflicts with hash handling in line 169 in Search.pm. That function will never search for "like %BLAH%" but will always use the hash.

This is definitely a bug.
(Who did that change and why?)

mherger
2007-05-31, 01:06
> It does not work. Somebody changed "comments" to "comments_value".
> This conflicts with hash handling in line 169 in Search.pm. That

Search.pm in which folder?

> (Who did that change and why?)

http://svn.slimdevices.com will tell you if you're really curious.

--

Michael

-----------------------------------------------------------------
http://www.herger.net/SlimCD - your SlimServer on a CD
http://www.herger.net/slim - AlbumReview, Biography, MusicInfoSCR

mherger
2007-05-31, 01:11
> Could anybody please confirm that searching for mp3 comments in 6.5.2
> works or does not work.

It does work for me (with a three week old nightly as well as with the
latest build).

--

Michael

-----------------------------------------------------------------
http://www.herger.net/SlimCD - your SlimServer on a CD
http://www.herger.net/slim - AlbumReview, Biography, MusicInfoSCR

mherger
2007-05-31, 01:19
> This is definitely a bug.

It's not. It's more probably an outdated html page in your browser's
cache. Or a broken skin (which one are you using?).

> (Who did that change and why?)

It's been done almost three months ago, to fix bug 4797.

--

Michael

-----------------------------------------------------------------
http://www.herger.net/SlimCD - your SlimServer on a CD
http://www.herger.net/slim - AlbumReview, Biography, MusicInfoSCR

JJZolx
2007-05-31, 01:48
It sure looks like it's broken to me, using a recent rev of 6.5.3. I can't get any results, no matter what I search for in comments. Doesn't matter if I search for a partial or an exact string. The comments are definitely in the database.

mherger
2007-05-31, 02:09
> It sure looks like it's broken to me, using a recent rev of 6.5.3. I

Odd. As I mentioned I successfully tried with two builds (todays and a
nightly from a few weeks ago). Are you using any of the external importers
like iTunes or MusicIP?

> comments are definitely in the database.

In the DB or your files?

--

Michael

-----------------------------------------------------------------
http://www.herger.net/SlimCD - your SlimServer on a CD
http://www.herger.net/slim - AlbumReview, Biography, MusicInfoSCR

JJZolx
2007-05-31, 02:19
> It sure looks like it's broken to me, using a recent rev of 6.5.3. I

Odd. As I mentioned I successfully tried with two builds (todays and a
nightly from a few weeks ago). Are you using any of the external importers
like iTunes or MusicIP?

No, I don't use any of those.


> comments are definitely in the database.

In the DB or your files?

Both. I checked the database to be sure it's not a scanning problem.

I also tried a couple different skins (my own, Default, Fishbone) with the same results.

JJZolx
2007-05-31, 02:27
I turned on SQL debugging and here's the query that is run when I searched for the string 'mfsl':


SELECT COUNT( * )
FROM tracks me
LEFT JOIN contributor_track contributorTracks ON ( contributorTracks.track = me.id )
LEFT JOIN comments comments ON ( comments.track = me.id )
WHERE ( ( ( comments.value LIKE ? ) )
AND ( ( contributorTracks.role = ? )
OR ( contributorTracks.role = ? )
OR ( contributorTracks.role = ? )
OR ( contributorTracks.role = ? ) ) )

: '%HASH 0X6CE724C%', '1', '2', '4', '5'

Looks like 'mfsl' is getting turned into 'HASH 0X6CE724C' for some reason.

slutz
2007-05-31, 10:47
It's the official 6.5.2 build no nighly or other build.
It's in Slim/Web/Pages/Search.pm

The original code is:

# Normalize the string queries
#
# Turn the track_title into track.title for the query.
# We need the _'s in the form, because . means hash key.
if ($newKey =~ s/_(titlesearch|namesearch|value)$/\.$1/) {

$params->{$key} = { 'like' => Slim::Utils::Text::searchStringSplit($params->{$key}) };
}

# Wildcard searches
if ($newKey =~ /comment/ || $newKey =~ /lyrics/) {

$params->{$key} = { 'like' => Slim::Utils::Text::searchStringSplit($params->{$key}) };
}

The line "if ($newKey =~ s/_(titlesearch|namesearch|value)" catches the comments_value (was comments in 6.5.1) and produces the hash. If you change to the following it works again:

# Normalize the string queries
#
# Turn the track_title into track.title for the query.
# We need the _'s in the form, because . means hash key.
if (!$newKey =~ /comment/ && $newKey =~ s/_(titlesearch|namesearch|value)$/\.$1/) {

$params->{$key} = { 'like' => Slim::Utils::Text::searchStringSplit($params->{$key}) };
}

# Wildcard searches
if ($newKey =~ /comment/ || $newKey =~ /lyrics/) {

$params->{$key} = { 'like' => Slim::Utils::Text::searchStringSplit($params->{$key}) };
$newKey =~ s/_(value)$/\.$1/;
}

Ok, it's not beautiful but it works.
And this is a change in 6.5.2 that I don't understand. It's simply renamed from comments to comments_value without considering the side effects of the "_"/"." and hashing.

JJZolx
2007-05-31, 10:52
It's the official 6.5.2 build no nighly or other build.
It's in Slim/Web/Pages/Search.pm

The original code is:

I filed a bug on this if you want to post comments or patches. It'll probably get more immediate attention there:

http://bugs.slimdevices.com/show_bug.cgi?id=5095

slutz
2007-05-31, 10:57
I'll simply append my last post.
I think that shows that there is something wrong.

slutz
2007-05-31, 11:07
Ah, you already did ;-)
Fine. I think they have all the information they need.

slutz
2007-06-01, 07:26
Fixed.
See attached patch in http://bugs.slimdevices.com/show_bug.cgi?id=5095