App-MPDJ

 view release on metacpan or  search on metacpan

lib/App/MPDJ.pm  view on Meta::CPAN

134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
  $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 )