mherger;452043 Wrote:
>
> This path doesn't make sense unless you run --noweb: filltemplatefile
> will
> use the initialized $skinMgr - which is NoWeb if and only if --noweb is
>
> being used. Unless CustomBrowse does something really odd. In what way
>
> does it use TT?
>
It reads a template with xml and template code and process it to
generate a xml file.
Here are some extracts
Initialization, executed once:
Code:
--------------------
sub getTemplate {
my $self = shift;
if(!defined($self->templateHandler)) {
$self->templateHandler(Template->new({
COMPILE_DIR => catdir( $serverPrefs->get('cachedir'), 'templates' ),
FILTERS => {
'string' => \&Slim::Utils::Strings::string,
'getstring' => \&Slim::Utils::Strings::getString,
'resolvestring' => \&Slim::Utils::Strings::resolveString,
'nbsp' => \&nonBreaking,
'uri' => \&URI::Escape::uri_escape_utf8,
'unuri' => \&URI::Escape::uri_unescape,
'utf8decode' => \&Slim::Utils::Unicode::utf8decode,
'utf8encode' => \&Slim::Utils::Unicode::utf8encode,
'utf8on' => \&Slim::Utils::Unicode::utf8on,
'utf8off' => \&Slim::Utils::Unicode::utf8off,
'fileurl' => \&templateFileURLFromPath,
},
EVAL_PERL => 1,
}));
}
return $self->templateHandler;
}
--------------------
Processing
Code:
--------------------
sub fillTemplate {
my $self = shift;
my $filename = shift;
my $params = shift;
my $output = '';
$params->{'LOCALE'} = 'utf-8';
my $template = $self->getTemplate();
if(!$template->process($filename,$params,\$output)) {
$self->logHandler->warn("ERROR parsing template: ".$template->error()."\n");
}
return $output;
}
--------------------
It never outputs the warning message so I think all processing within
Custom Browse works as it should. Also, the result is cached so it's
really only processed the first time when SqueezeCenter is started with
a new version of Custom Browse. After a second restart the "process"
call is never made by Custom Browse.
It feels like I reach some limit, because if I limit the number of
calls to the process method in Custom Browse to around 80 calls it
works.
--
erland
Erland Isaksson
'My homepage' (http://erland.isaksson.info) (Install my plugins through
Extension Downloader)
(Developer of 'TrackStat, SQLPlayList, DynamicPlayList, Custom Browse,
Custom Scan, Custom Skip, Multi Library, Title Switcher and Database
Query plugins'
(http://wiki.erland.isaksson.info/index.php/Category:SlimServer))
------------------------------------------------------------------------
erland's Profile: http://forums.slimdevices.com/member.php?userid=3124
View this thread: http://forums.slimdevices.com/showthread.php?t=67060
_______________________________________________
beta mailing list
[email protected]
http://lists.slimdevices.com/mailman/listinfo/beta