sub _playersBusy { my $checkpower = $prefs->get('checkpower'); my $hiTime; my $diff; for my $client (Slim::Player::Client::clients()) { if ($checkpower && $client->power()) { main::DEBUGLOG && $log->is_debug && $log->debug("Player " . $client->name() . " is powered " . ($client->power() ? "on" : "off") . "..."); return 1; } $hiTime = Time::HiRes::time(); $diff = $hiTime - $client->lastActivityTime; if ($diff <= INTERVAL) { main::DEBUGLOG && $log->is_debug && $log->debug("Player " . $client->name() . " is busy at $hiTime $diff ago"); return 1; } if ( $client->isPlaying() ) { main::DEBUGLOG && $log->is_debug && $log->debug("Player " . $client->name() . " is playing..."); return 1; } if ( $client->isUpgrading() ) { main::DEBUGLOG && $log->is_debug && $log->debug("Player " . $client->name() . " is upgrading..."); return 1; } } return 0; }