diff options
| author | Ben Sima <ben@bensima.com> | 2025-12-02 15:52:27 -0500 |
|---|---|---|
| committer | Ben Sima <ben@bensima.com> | 2025-12-02 15:55:49 -0500 |
| commit | b60fc6f95e68c8581e2cec48f8d99e7c467a1db2 (patch) | |
| tree | af582c102744a7d4804f7fa9fba473fd42241fdf /Biz | |
| parent | 9e65e80276aeb33c0f917d005e621a18158fffee (diff) | |
Remove pyproject=true, use format=setuptools, add toggle_episode_public
Diffstat (limited to 'Biz')
| -rw-r--r-- | Biz/PodcastItLater/Core.py | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/Biz/PodcastItLater/Core.py b/Biz/PodcastItLater/Core.py index 3a88f22..62eead8 100644 --- a/Biz/PodcastItLater/Core.py +++ b/Biz/PodcastItLater/Core.py @@ -1073,6 +1073,18 @@ class Database: # noqa: PLR0904 logger.info("Unmarked episode %s as public", episode_id) @staticmethod + def toggle_episode_public(episode_id: int) -> None: + """Toggle an episode's public status.""" + with Database.get_connection() as conn: + cursor = conn.cursor() + cursor.execute( + "UPDATE episodes SET is_public = NOT is_public WHERE id = ?", + (episode_id,), + ) + conn.commit() + logger.info("Toggled public status for episode %s", episode_id) + + @staticmethod def get_public_episodes(limit: int = 50) -> list[dict[str, Any]]: """Get public episodes for public feed.""" with Database.get_connection() as conn: |
