It's definitely the space in the directory path that is causing the
problem.
For my own local fix I found that hard coding the value returned by
scriptPath() to /scripts and putting my script files in there worked
fine.
Thanks for your continuing work on this. Unfortunately the new code you
posted doesn't quite solve the problem with the space character.
Escaping the space with a backslash works for the system command, but
fails on the readDirectory command in scriptList() (line 183 in
Plugin.pm). Because of this no script files get listed in the settings
web page.
To get around this, I created two scriptPath() subroutines; one -
scriptPath() - doesn't do anything to escape spaces on unix, and the
other - scriptPathSpecial() - does. I then altered the code so that
scriptPath() is called by scriptList(), and scriptPathSpecial is called
by the four sub CommandCallbackX subroutines.
I'm not quite sure when 'play' => sub {...} (line 139) is called, so
didn't test it, but I suspect that would also need to use
scriptPathSpecial() rather than scriptPath().
----------------------------------
sub scriptPath {
my $scriptPath = catfile((Slim::Utils::Prefs::dir() ||
Slim::Utils::OSDetect::dirsFor('prefs')),'scripts');
return $scriptPath;
}
sub scriptPathSpecial {
my $scriptPath = catfile((Slim::Utils::Prefs::dir() ||
Slim::Utils::OSDetect::dirsFor('prefs')),'scripts');
if (Slim::Utils::OSDetect::OS ne 'win') { $scriptPath =~ s/ /\\
/g };
return $scriptPath;
}
---------------------------------
--
Creeky
------------------------------------------------------------------------
Creeky's Profile: http://forums.slimdevices.com/member.php?userid=9566
View this thread: http://forums.slimdevices.com/showthread.php?t=41941
_______________________________________________
plugins mailing list
[email protected]
http://lists.slimdevices.com/lists/listinfo/plugins