Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Auto delete not working, podcast files never deleted #2495

Closed
chrisspen opened this issue Nov 29, 2017 · 25 comments
Closed

Auto delete not working, podcast files never deleted #2495

chrisspen opened this issue Nov 29, 2017 · 25 comments
Labels
Needs: Mock-up or user story Feature or enhancement request with an impact on the UI/UX, and needs mock-ups or user stories Type: Possible bug Issues that seem to be a bug, but haven't been confirmed yet

Comments

@chrisspen
Copy link

App version: 1.6.4.1

Android version: 7.1.1 (LineageOS 14.1)

Device model: HTC One m7

Expected behaviour: After an episode is removed from the queue, it should be deleted.

Current behaviour: I started receiving warnings from the Google app updater, saying I didn't have enough space left on my device to install updates. Using the Android storage analyzer, it found that apps were consuming most of my storage, and that AntennaPod was consuming 10GB by itself. I wasn't sure why AntennaPod would be consuming so much, since I hadn't downloaded that many podcasts, and I have "auto-delete" enabled, so I thought downloaded podcasts that I've listened to or removed from my queue unlistened, would be auto-deleted.

However, this doesn't seem to be the case. I used the app SSHelper to ssh into my phone, and cd'ed to /storage/emulated/0/Android/data/de.danoeh.antennapod/files/media, where AntennaPod says it keeps all its data. And sure enough, in the folders for the podcasts whose episodes I've either listened to or have removed from my queue, there are a ton of files, some dating back months.

Until this bug is fixed, as a workaround, can I delete this entire directory, or will that destroy Antennapod? There seems to be a folder for every podcast I've ever listened to, even ones that I unsubscribed from and removed from Antennapod. Why is it not deleting those folders?

@chrisspen
Copy link
Author

I did indeed delete this entire folder and it seems to have not adversely effected AntennaPod. To summarize, to force cleanup all podcast files, SSH into your phone or open a terminal on your phone and run:

 cd /storage/emulated/0/Android/data/de.danoeh.antennapod/files/media
 rm -R -- */

@micressor
Copy link

I confirm this behaviour in version 1.6.4.1 installed via f-droid.

AntennaPod should not only delete when memory space is being used, but should delete close to real time. The following bugreport matches this #399.

@LongHairedHacker
Copy link

I can confirm this behaviour on version 16.4.5 installed from the playstore.

Running into disk space problems I've just checked my antenna pod media folder and found about 2GByte of old episodes, dating back from 2016 to a few weeks ago.
Most of them are episodes I listened to completely from start to end.

@yzerman19
Copy link

I don't see this issue, and I use an external card for my storage.

Maybe your card became un-mounted when episodes were being downloaded?
another thing to check is that the storage location is still defined as you want: Settings > Storage > Choose Folder. Make sure it says /storage/70D7-75E7/Android/data/de.danoeh.antennapod/ and not /storage/emulated/0/....

@LongHairedHacker
Copy link

Can't be the cause of the issue in my case, as I don't have an SD-Card in my phone.
I ran into some weird compatibility problem with most of the cards I tried so far and couldn't be bother to debug them for the last few years.
Everything goes straight to internal flash and I would surely notice if that was being unmounted.

@chrisspen
Copy link
Author

My phone also has no card, so it can't be an unmounting problem.

@openbrian
Copy link

Any update on this. I also see this bug.

@orionlee
Copy link
Contributor

orionlee commented Jun 9, 2018

For those who experienced the problem, you could try to enable Automatic Download, specify Episode Cache and Episode Cleanup. It should then cleanup played episodes periodically.

If it works, it can serve as a workaround (and even more desirable for some people). If it does not work, at least it will help to shed some light on the nature of the problem.

@jasonbarbour
Copy link

I suffer from this bug also under version 1.8.1.

@ByteHamster ByteHamster added this to the Rework automatic deletion milestone Apr 17, 2020
@rafpov
Copy link

rafpov commented Apr 18, 2020

Bug is still present on version 1.8.1 (Android 9, Nokia 6)

@keunes keunes added the Type: Possible bug Issues that seem to be a bug, but haven't been confirmed yet label Oct 2, 2020
@JimAlps
Copy link

JimAlps commented Dec 4, 2020

Hi. I also experience this bug since a lot of time. I'm actually running version 2.0.3
I think I know how to reproduce :

  • Use auto download
  • Get a long list of new episodes to download.
  • While some episodes are downloading (two at a time), remove from the list (by swaping) some episodes not downloaded yet, because you don't want them. Sometimes, (only in versions 2.0+ I think) they reappear in grey at the end of the list, but they are still not downloaded. In this case, remove them again.
  • When all downloads are finished, you don't see those episodes on your list. But they are on the filesystem and will never be deleted.

Btw thanks for this great app.

@JimAlps
Copy link

JimAlps commented Dec 12, 2020

I found the problem in the code. When episode cache size is unlimited in preferences, episodes are never deleted by EpisodeCleanupAlgorithm because getNumEpisodesToCleanup always return 0 when getEpisodeCacheSizeUnlimited.
I'm using APQueueAlgorithm, but I think it also occurs when using APCleanupAlgorithm. I think this is supposed to happen only when using APNullCleanupAlgorithm.
It happens even if there is no space left on device. I'm not sure how to correct this, because I don't understand this logic to delete episode only when space is needed. For me, anything on getCandidates() of those algorithm should be delete all the time. I use unlimited cache size not to keep everything that I clearly choose to remove by cleanup preference, but to download an unlimited number of episode (unlistened).

@ByteHamster
Copy link
Member

I use unlimited cache size not to keep everything that I clearly choose to remove by cleanup preference, but to download an unlimited number of episode (unlistened).

I think it is weird that episode cleanup and auto-download influence each other. That's why I think that those settings should basically be re-written. Issues related to that are tracked in milestone https://github.com/AntennaPod/AntennaPod/milestone/47

I think the settings should look more like this:

  • Auto download
    • Limit
      • Max number of episodes
      • Max space used
    • Enable when on battery
  • Auto delete
    • Trigger
      • After playing
      • When removing from queue
      • X hours after playing
      • After X days, even when unplayed
      • When more than X episodes (per podcast)
    • Do not delete favorites

Also related: #4751 and #4693. There is a similar discussion in #1275

Ping to some people who worked on automation options recently: @spacecowboy @tonytamsf @orionlee @keunes - anyone up for rewriting the feature? :)

@spacecowboy
Copy link
Contributor

@ByteHamster am I correct in assuming that you think the default options should be the first listed? and that the options are mutually exclusive?

or are they individual settings?

@ByteHamster
Copy link
Member

and that the options are mutually exclusive?

That's up to discussion :) I think there could be use-cases where multiple options would be helpful. Not sure how we can make that as user-friendly as possible, though. Maybe we could do something similar to the mock-up in #4708

am I correct in assuming that you think the default options should be the first listed?

I think the default option should be to not delete or download anything.

@ByteHamster
Copy link
Member

I just realized that AntennaPod has a feature to automatically download episodes that are added to the queue. That feature should probably get its own setting instead of being always enabled.

@JimAlps
Copy link

JimAlps commented Mar 16, 2021

For those annoyed by this bug (especially if you don't have much space), here is a nasty but simple patch, against git version, to resolve the problem, until the feature can be rewritten. Note that it doesn't delete episodes immediately but when the cleanup algo is called, which is quite often. This will clean all your old epidodes which are not in the queue anymore.

delete_episodes_not_in_queue.txt

@spacecowboy
Copy link
Contributor

@JimAlps see also #4693

@dcjkfgdjhd
Copy link

In the current version of AP, I cannot even find any way to clean up manually. (I have set the storage limit to "Unlimited" in order to prevent losing valuable old episodes that I still want to listen to.)

I have 22 GB of episodes on my device, including hundreds that I swiped away from the queue, because they don't interest me. They never go away.

In the past, there was a way (I believe in the Downloads screen) to filter for all played episodes and then perform a batch operation on them to delete them.

This seems to not be possible anymore. In the "Episodes" screen I can filter, but not perform a batch operation. In the "Download" screen I can select multiple files and perform batch operations, but there is no way to filter for files that are not in the queue or that are marked as played.

Is there some way to do this that I missed or is this really impossible now?

@dcjkfgdjhd
Copy link

This is a serious, serious bug.

I just had to to delete 1800 episodes from my device because its memory was overflowing.

Of those, about 3/4 were episodes I had already listened to. There was no way to delete only these.

@spacecowboy
Copy link
Contributor

This is a serious, serious bug.

I just had to to delete 1800 episodes from my device because its memory was overflowing.

Of those, about 3/4 were episodes I had already listened to. There was no way to delete only these.

You just stated in your previous message that you have set the storage limit to Unlimited. So you aren't being affected by any bug. You've explicitly told AntennaPod not to delete anything.

@dcjkfgdjhd
Copy link

dcjkfgdjhd commented Jun 19, 2022

Errm, did you even read the previous posts?

AntennaPod is not deleting episodes that have already been listened to and epsiodes that have been manually removed from the queue. Of course those need to be deleted, and of course it is a bug if they are not.

And there isn't even a practical way to clean up manually.

@spacecowboy
Copy link
Contributor

Errm, did you even read the previous posts?

AntennaPod is not deleting episodes that have already been listened to and epsiodes that have been manually removed from the queue. Of course those need to be deleted, and of course it is a bug if they are not.

And there isn't even a practical way to clean up manually.

I am the first to agree that the delete logic is not perfect. And the settings are confusing because they are spread across different sections.

But if I recall correctly, and nothing has changed since, episodes are only deleted as part of the automatic sync. And it primarily depends on the Episode Cache size and Episode Cleanup settings.

Change both of those to something reasonable. Like size 100, and clean up when Not Favorited or Not In Queue or After finishing.

@dcjkfgdjhd
Copy link

But if I recall correctly, and nothing has changed since, episodes are only deleted as part of the automatic sync. And it primarily depends on the Episode Cache size and Episode Cleanup settings.

Change both of those to something reasonable. Like size 100, and clean up when Not Favorited or Not In Queue or After finishing.

I have tested this by now. It does not work. I set the episode limit to 500 and auto-delete to "not in queue". Audio files belonging to episodes that are not in the queue anymore nonetheless do not get auto-deleted on auto-sync.

I suspect the reason is that they would only get deleted when there already are 500 episodes and space needs to be freed up to download new episodes. But of course that makes zero sense. Whether I want to keep an episode or not only depends on that one episode (interested yes/no? already listened to yes/no? decided to skip it yes/no?). Other episodes simply have absolutely no bearing on that decision, so their number also should not play a role in the algorithm.

(Also I would like to choose both "not in queue" and "after finishing" as reasons for deletion but that is impossible because you can choose only one criterion. Also a strange design choice.)

@ByteHamster
Copy link
Member

This is a usability problem, not a functional problem. The usability issues are already tracked in #4795. Closing to keep the discussion in one place.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs: Mock-up or user story Feature or enhancement request with an impact on the UI/UX, and needs mock-ups or user stories Type: Possible bug Issues that seem to be a bug, but haven't been confirmed yet
Projects
None yet
Development

No branches or pull requests