cache) { $cached = $this->cache->get($cacheKey); if ($cached !== false) { return json_decode($cached, true) ?? []; } } $response = $this->makeRequest('GET', 'optimized_books_progress?select=isbn,progress'); $result = []; foreach ($response as $row) { if (!empty($row['isbn'])) { $result[$row['isbn']] = (int) $row['progress']; } } if ($this->cache) { $this->cache->set($cacheKey, json_encode($result), $this->cacheTTL); } return $result; } catch (\Throwable $e) { error_log('BookProgressHandler::getAllProgress error: ' . $e->getMessage()); return []; } } }