Skip to content

Removing a podcast deletes its DownloadedEpisodes rows but leaves the downloaded files on disk #1038

Closed

Description

@Fguarien

Summary

remove_podcast / remove_podcast_id / remove_podcast_by_name_url (rust-api/src/database.rs) delete DownloadedEpisodes (and Episodes) for the podcast inside a transaction, but never remove the files referenced by downloadedlocation. After an unsubscribe, the audio files stay in the downloads directory with nothing in the database pointing at them. Re-subscribing to the same feed creates new episodeids, so the old files are never matched again; with auto-download on, they get downloaded a second time.

Observed (PinePods 0.9.0, PostgreSQL)

On one instance, 50 files of 11 re-subscribed podcasts and 10 files of 5 unsubscribed podcasts were left in /opt/pinepods/downloads without any DownloadedEpisodes row (about 1 GB). Re-subscribed copies also came back with autodownload = false, so the user's auto-download setting was silently lost.

Expected

When removing a podcast, either delete the downloaded files (the per-episode delete-download path already handles files), or offer a "keep downloaded files" choice. In both cases, never leave files that nothing references.

Activity

  1. madeofpendletonwool commented on Oct 29, 2026

    @madeofpendletonwool
    Owner

    Fixed in #1039 - Removing a podcast now cleans up its downloaded files too, not just the database entries. Will be released officially with the next release coming soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions