App-MPDJ
view release on metacpan or search on metacpan
lib/App/MPDJ.pm view on Meta::CPAN
134135136137138139140141142143144145146147148149150151152153154
$self
->mpd->repeat(0);
$self
->mpd->random(0);
if
(
$self
->config->get(
'calls-freq'
)) {
my
$now
=
time
;
$self
->{last_call} =
$now
-
$now
%
$self
->config->get(
'calls-freq'
);
$self
->
log
->notice(
"Set last call to $self->{last_call}"
);
}
}
sub
update_cache {
my
(
$self
) =
@_
;
$self
->
log
->notice(
'Updating music and calls cache...'
);
foreach
my
$category
((
'music'
,
'calls'
)) {
@{
$self
->{
$category
} } =
grep
{
$_
->{type} eq
'file'
}
$self
->mpd->list_all(
$self
->config->get(
"${category}-path"
));
my
$total
=
scalar
(@{
$self
->{
$category
} });
( run in 0.360 second using v1.01-cache-2.11-cpan-4e96b696675 )