App-MPDJ

 view release on metacpan or  search on metacpan

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

  $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} });

 view all matches for this distribution
 view release on metacpan -  search on metacpan

( run in 0.595 second using v1.00-cache-2.02-grep-82fe00e-cpan-4673cadbf75 )