Get category slug by ID (cached).
(self, cat_id: int)
| 112 | return all_posts |
| 113 | |
| 114 | def get_category_slug(self, cat_id: int) -> str: |
| 115 | """Get category slug by ID (cached).""" |
| 116 | if cat_id in self._category_cache: |
| 117 | return self._category_cache[cat_id] |
| 118 | cat = self.api_get(f"categories/{cat_id}") |
| 119 | if cat and isinstance(cat, dict): |
| 120 | slug = cat.get("slug", "") |
| 121 | self._category_cache[cat_id] = slug |
| 122 | return slug |
| 123 | return "" |
| 124 | |
| 125 | def detect_subcategory(self, post: dict) -> str: |
| 126 | """Detect insights subcategory from post categories.""" |
no test coverage detected