PDA

View Full Version : MusicInfoSCR problem, possible bug



erland
2008-12-21, 03:39
Michael, hopefully you are seeing this.

I have some problem with the Title Switcher plugin when it integrates with MusicInfoSCR. The problem is the following code in Info.pm in MusicInfoSCR:


if ( $client->pluginData('remoteData') ) {

foreach my $tag (@remoteTags) {
$formattedString =~ s/$tag/_MIS_REMOTE_$tag/g;
}

}

The problem with this is that if $formattedString is set to "TITLESWITCHERALBUMARTIST" this code section will replace it to "_MIS_REMOTE_TITLESWITCHER_MIS_REMOTE_ALBUM_MIS_REM OTE_ARTIST". It's of course correct to do the replacement if $formattedString was "TITLE - ARTIST" but I think it's incorrect if TITLE or ARTIST is part of a another word (like TITLESWITCHERARTIST, ALBUMARTIST). Is it possible to change this so it replaces the remoteTags keywords if they are found as separate words but not if they are found as part of a another word ?

I can do an ugly correction in Title Switcher to solve it, but I would prefer avoiding dependencies in Title Switcher to MusicInfoSCR internals like the string _MIS_REMOTE_ and the @remoteTags array.

Leplus
2008-12-21, 04:04
So, I think this problem is related to this thread ?

http://forums.slimdevices.com/showthread.php?t=55240&page=3

erland
2008-12-21, 04:17
So, I think this problem is related to this thread ?

http://forums.slimdevices.com/showthread.php?t=55240&page=3

Yes, just to confirm, the result of the code in MusicInfoSCR which I mentioned in my initial post here is that Title Switcher doesn't currently work with radio stations and podcasts.

Leplus
2008-12-21, 07:07
Yes, just to confirm, the result of the code in MusicInfoSCR which I mentioned in my initial post here is that Title Switcher doesn't currently work with radio stations and podcasts.
Thank you very much for pointing the possible problem.

mherger
2008-12-22, 03:45
Erland,

don't have much time right now. But I thought this was fixed by changing
the regex:

> $formattedString =~ s/$tag/_MIS_REMOTE_$tag/g;

$formattedString =~ s/\b$tag\b/_MIS_REMOTE_$tag/g;

The regex needs to respect word borders (\b).

Michael

dip
2008-12-22, 08:52
Where do I find the info.pm comprising this code that I can change it? I do not find an info.pm file. Is that precompiled since I use the installer version of Squeezecenter on Windows and the new Extension Downloader?

erland
2008-12-22, 17:27
Erland,

don't have much time right now. But I thought this was fixed by changing
the regex:

> $formattedString =~ s/$tag/_MIS_REMOTE_$tag/g;

$formattedString =~ s/\b$tag\b/_MIS_REMOTE_$tag/g;

The regex needs to respect word borders (\b).

If I change the MusicInfoSCR code like your suggestion it seems to work correctly.

erland
2008-12-22, 17:31
Where do I find the info.pm comprising this code that I can change it? I do not find an info.pm file. Is that precompiled since I use the installer version of Squeezecenter on Windows and the new Extension Downloader?
It's packaged in the par file in the Cache/InstalledPlugins/Plugins/MusicInfoSCR/lib/ directory.

You can extract it with a zip tool, but it requires some knowledge if you actually like to change it and use the changes.

dip
2008-12-23, 15:03
Thanks, it works great now with this amendment.

mherger
2008-12-28, 11:30
> Thanks, it works great now with this amendment.

Thanks for testing. Will update my repository soon... (next year :-))

--

Michael

mherger
2008-12-28, 11:40
> If I change the MusicInfoSCR code like your suggestion it seems to work
> correctly.

Thanks. I'll update my repository in the next few days. Hopefully :-)

--

Michael