cache) { $cached = $this->cache->get($cacheKey); if ($cached !== false) { return json_decode($cached, true) ?? []; } } $response = $this->makeRequest('GET', 'optimized_books_progress?select=isbn,progress,status'); $result = []; foreach ($response as $row) { if (!empty($row['isbn'])) { $result[$row['isbn']] = [ 'progress' => (int) $row['progress'], 'status' => $row['status'] ?? null, ]; } } 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 []; } } }