diff --git a/src/database/bundles.py b/src/database/bundles.py index 5562f6f7..b0d11541 100644 --- a/src/database/bundles.py +++ b/src/database/bundles.py @@ -112,10 +112,6 @@ async def list_accounts(self, active_only: bool = False) -> list[Account]: """Список аккаунтов (с секретом сессии); `active_only` — только активные.""" return await self.accounts.get_accounts(active_only) - async def list_live_usable_accounts(self, active_only: bool = False) -> list[Account]: - """Аккаунты, пригодные для живого подключения (валидная читаемая сессия).""" - return await self.accounts.get_live_usable_accounts(active_only) - async def list_account_summaries(self, active_only: bool = False) -> list[AccountSummary]: """Безопасные для UI сводки аккаунтов (`AccountSummary`, без `session_string`).""" return await self.accounts.get_account_summaries(active_only) @@ -136,9 +132,7 @@ async def update_flood(self, phone: str, until) -> None: """Записать `flood_wait_until` для аккаунта (момент окончания FLOOD_WAIT).""" await self.accounts.update_account_flood(phone, until) - async def update_premium(self, phone: str, is_premium: bool) -> None: - """Обновить флаг Premium-статуса аккаунта.""" - await self.accounts.update_account_premium(phone, is_premium) + @dataclass(frozen=True) @@ -544,10 +538,6 @@ async def delete_messages_for_channel(self, channel_id: int) -> int: """Удалить все сообщения канала; вернуть число удалённых строк.""" return await self.messages.delete_messages_for_channel(channel_id) - async def get_message_stats(self) -> dict: - """Сводная статистика по таблице сообщений (счётчики и т.п.).""" - return await self.messages.get_stats() - async def count_matching_prefixes_in_other_channels( self, channel_id: int, diff --git a/src/database/repositories/channels.py b/src/database/repositories/channels.py index a9ad1666..a1236364 100644 --- a/src/database/repositories/channels.py +++ b/src/database/repositories/channels.py @@ -619,15 +619,3 @@ async def set_channel_tags(self, channel_pk: int, tag_names: list[str]) -> None: SELECT ?, id FROM tags WHERE name = ?""", (channel_pk, name), ) - - async def get_channels_by_tag(self, tag: str) -> list[Channel]: - """Каналы, помеченные данным тегом, по возрастанию pk.""" - cur = await self._db.execute( - """SELECT c.* FROM channels c - JOIN channel_tags ct ON ct.channel_pk = c.id - JOIN tags t ON t.id = ct.tag_id - WHERE t.name = ? - ORDER BY c.id""", - (tag,), - ) - return [self._map_channel(r) for r in await cur.fetchall()] diff --git a/src/database/repositories/dialog_cache.py b/src/database/repositories/dialog_cache.py index b3057211..551bb9a0 100644 --- a/src/database/repositories/dialog_cache.py +++ b/src/database/repositories/dialog_cache.py @@ -120,14 +120,6 @@ async def clear_dialogs(self, phone: str) -> None: ) await self._database.execute_write("DELETE FROM dialog_cache WHERE phone = ?", (phone,)) - async def has_dialogs(self, phone: str) -> bool: - """True, если для аккаунта есть хотя бы один кэшированный диалог.""" - cur = await self._db.execute( - "SELECT 1 FROM dialog_cache WHERE phone = ? LIMIT 1", - (phone,), - ) - return bool(await cur.fetchone()) - async def get_cached_at(self, phone: str) -> datetime | None: """Время самого свежего кэшированного диалога аккаунта (для оценки устаревания).""" cur = await self._db.execute( diff --git a/src/database/repositories/generation_runs.py b/src/database/repositories/generation_runs.py index bcfdfbff..b52c0956 100644 --- a/src/database/repositories/generation_runs.py +++ b/src/database/repositories/generation_runs.py @@ -392,18 +392,6 @@ async def list_by_pipeline( rows = await cur.fetchall() return [self._to_generation_run(row) for row in rows] - async def list_by_status(self, statuses: list[str], limit: int = 20) -> list[GenerationRun]: - """List runs filtered by execution status (pending/running/completed/failed).""" - if not statuses: - return [] - placeholders = ",".join("?" * len(statuses)) - cur = await self._db.execute( - f"SELECT * FROM generation_runs WHERE status IN ({placeholders}) ORDER BY id DESC LIMIT ?", - (*statuses, limit), - ) - rows = await cur.fetchall() - return [self._to_generation_run(row) for row in rows] - async def get_calendar_stats(self) -> dict: """Return counts grouped by moderation_status, plus published count.""" cur = await self._db.execute(