I believe the primary use of global episode cache is used to prevent an app from downloading an excessive number of new episodes. The problem is that when limit is reached the app will start deleting episodes globally. And since auto download fetches the newest episodes globally, feeds will compete for each other over downloads (A feed with many new episodes will beat a feed with only one) and could result in download starvation of other feeds.
Many have complained about this and many have proposed suggestions to fix it. Many have suggested a feed specific auto download settings. After some thought and reading through the issues, I have reached the same conclustion. Here, I will explain why I support this and my specific proposal.
A global setting is not entirely wrong and many apps have it, like ourselves. But it only works when it is assumed that no download limit exists. In this case, there is no starvation. However, assuming there is a set limit, things get a little complicated. It seems that AP originally didn’t have a episode limit and was added later. Overtime other features were added without a proper redisgn leading to our current need for a complete rework.
Our current solution to this problem seems to be auto deleting episodes to help make room. But this only minimizes the problem and the problems mentioned above could occur in certain cases. Even more important, the implementation was ill designed, since we already have a type of auto deletion elsewhere in the app, leading to confusion and user complaints (#1486, #3063). After many more complaints, tt has been decided to rework the entire feature. @Bytehamster has requested voluteers and this is my reply.
To come up with a solution, I considered the filed issues under the mlestone, ‘Rework auto download’
I believe the most useful suggestion is ‘the keep last N episodes suggestions’ and used it as the basis for my solution.
My solution is essentially to implement the above suggestion by removing the global episode download limit and replacing it with a feed specific setting ‘keep last N episodes’ (#2077)
With this feed specific setting to limit the number of episodes to keep, a global setting to limit episodes serves no purpose. Besides it will help in reducing confustion, and eliminates many issues automatically (#5236, #4795)
Below, I’ve added my own specific implemntation ideas and I’m open to other suggestions.
This setting will not be a a hard limit like the global setting, but something a soft limit. Soft meanig that the will not eforce that epsidoes passed N will not be allowed. The setting only makes sure the last N episodes are downloaded. No assumtions will be made about episodes past N. This will be entirely managed by a seperate episode auto delete feature. And will work nicely to solve #1856.
In the current design, an episode clean up algorithmm is used by auto download service to make room for new episodes. With the new design, this will be decaupled, as suggested by @Bytehamser, from auto download. This means auto deleting will now only be found and set under one location (maybe storage settings). And code will be cleaner and better able to handle new features…
I came to this approach for a ‘soft limit’ after realizing that coupling auto download and auto delete is indeed a very bad idea. It makes implementing keep N episodes very complicated and is not necssary if we use this ‘soft limit’
The auto delete setting will allow the user to select the cretieria for deleting episodes. It will implment many of the suggestions regarding finer control of auto delete (#1275, #746). With feed specific episode limit, auto delete can be simplified to only deleting deleting episodes outside of the N epsidoes definied by feed settings. There is no longer a need to clean up episodes to help auto download work better and no starvation of feeds.
The only immediate issues I can see from this design is the following:
a. Not having easy way to determine the number of download limit for all podcasts.
b. Having to micro manage auto downloads
a. Improve stats, such as storage stats which will display the number of episodes on device and storage in GB
b. Have a defaultl N setting and a retain the gobal setting to turn on auto download for all feeds
I hope I have considered all the possible issues and comments in the milestone. Whether this solution is used, I hope this can get the ball rolling on this milestone.
I apologize for the length. I wanted to be as clear as possible.