amugofjava / anytime_podcast_player

Simple, easy to use Podcast player app written in Flutter and Dart.
BSD 3-Clause "New" or "Revised" License
376 stars 99 forks source link

Feature/automatically remove downloaded played episodes #119

Open mrkrash opened 4 months ago

mrkrash commented 4 months ago

I have added switch in settings section for enable/disable automatic erase of played downloaded episodes. Erasing occurs as a result of the event AudioProcessingState.completed in audio player service. I also write test for settings page but I don't know how to simulate the player event and then write a test for this new feature.

Close #112

mrkrash commented 4 months ago

If you want, give me some pointers. I could add also Italian language.

amugofjava commented 2 months ago

I have been testing this. It seems to work OK on an emulator, but I am getting issues on real devices. With the option enabled, at the end of an episode playback stalls and the episode is not deleted. I suspect a lock somewhere.

Have you have any similar issues testing this on real devices?

mrkrash commented 2 months ago

No, but I can test on other device. Test it and report again.

mrkrash commented 2 months ago

Hi @amugofjava, in the last two weeks I have tested on a physical device, my Oppo Android Phone. I have used it to listen to several podcasts of different lengths and have never encountered any uncertainties or problems. Can I do some more tests?

amugofjava commented 2 months ago

Hi @mrkrash,

Thanks for the update. I'll do some more testing here, see if I can reproduce the issue. From memory, when it happened to me I had a few episodes of Podnews Daily queued up. These are short episodes and when it finished episode one, and tried to start episode two it stalled when the auto delete option was enabled.

I'll let you know what I find. Thanks.

amugofjava commented 1 month ago

Hi @mrkrash,

I have managed to reproduce the issue. What is happening is that, when the delete option is enabled it is being called at the end of every episode and not just for those that have been downloaded.

To reproduce, enable the delete option and then stream an episode rather than playing a downloaded one. At the end of the episode an exception will be raised and playback will stop.

mrkrash commented 1 month ago

Hi @amugofjava, I have added a control that proceed with deletion only if episode has download status to downloaded. I have tested it on my android phone and work but, when you have two minutes, can you test?

amugofjava commented 2 weeks ago

Hi @mrkrash,

Sorry for the slow response, I've had a busy few weeks. I've given this update a quick test and for me the episodes are not deleting once played. I will dive into the code when I can to see what's going on, but giving you a heads up so you can take a look too.

Is it all working for you? If you queue up a mix of downloaded and streamed episodes, are all the episodes played successfully and do all the downloaded episodes get removed?

mrkrash commented 5 days ago

Hi @amugofjava, I haven't test a mixed queue, sorry. I'll test it and verify where is the error.