fix(scrobble.php): refactor isTrackAlreadyScrobbled method to avoid triggering warnings
This commit is contained in:
parent
bcb89ceb95
commit
7b2584367c
3 changed files with 8 additions and 3 deletions
|
@ -89,7 +89,12 @@ class NavidromeScrobbleHandler extends ApiHandler
|
|||
|
||||
private function isTrackAlreadyScrobbled(array $track): bool
|
||||
{
|
||||
if (empty($track["playDate"])) return false;
|
||||
|
||||
$playDate = strtotime($track["playDate"]);
|
||||
|
||||
if ($playDate === false) return false;
|
||||
|
||||
$existingListen = $this->fetchFromApi("listens", "listened_at=eq.{$playDate}&limit=1");
|
||||
|
||||
return !empty($existingListen);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue