mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-06-18 21:15:16 +02:00
feat(podcasts): add audio_exists storage helper
This commit is contained in:
parent
3e539311a2
commit
d2558e546e
1 changed files with 7 additions and 0 deletions
|
|
@ -42,6 +42,13 @@ def open_audio_stream(podcast: Podcast) -> AsyncIterator[bytes]:
|
|||
return get_storage_backend().open_stream(podcast.storage_key)
|
||||
|
||||
|
||||
async def audio_exists(podcast: Podcast) -> bool:
|
||||
"""Whether the podcast's stored audio object is actually present."""
|
||||
return bool(podcast.storage_key) and await get_storage_backend().exists(
|
||||
podcast.storage_key
|
||||
)
|
||||
|
||||
|
||||
async def purge_audio(podcast: Podcast) -> None:
|
||||
"""Delete a podcast's stored audio if present; a missing object is fine."""
|
||||
await purge_audio_object(podcast.storage_key)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue