fix(scrobble.php): refactor isTrackAlreadyScrobbled method to avoid triggering warnings

This commit is contained in:
Cory Dransfeldt 2025-06-04 20:38:18 -07:00
parent bcb89ceb95
commit 7b2584367c
No known key found for this signature in database
3 changed files with 8 additions and 3 deletions

View file

@ -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);