Git Product home page Git Product logo

Comments (5)

teq0 avatar teq0 commented on June 29, 2024

I'm happy to have a go at fixing this if someone can point me in the right direction. I've scanned the code and it's not clear what needs to be changed i.e. it's not clear to me how adding favorites actually works.

from volumio-plugins.

teq0 avatar teq0 commented on June 29, 2024

@ChrisPanda I've made some progress, I can get podcasts saved into Favourites OK, and under certain circumstances they will even play from Favourites, but there are a couple of fairly large issues that I can see.

Firstly, the code relies on self.currentEpisodes, which may not be populated if the user goes straight to Favourites after Volumio starts up, or could contain the episodes for a different podcast, if the user had recently browsed to a different podcast. Right now this will either kill Volumio with an error or play the wrong podcast.

I think the fix for this is to store the list of episodes under each podcast in self.podcasts, rather than a single "global" list of the last podcast loaded, and to look up episodes using both the podcast name and the episode number, and also to load the list from the RSS URL on demand so that it's not necessary for the user to have already browsed to the specific podcast.

Secondly, the URI scheme is based on integer indexes (e.g. podcast/3/2), which means that if a podcast is ever removed from the list then the URI for any existing favourites for podcasts that were later in the list than the one that was removed will now have incorrect indexes. I think the only way to fix this is to change the URI scheme to use the name of the podcast as the second item, for example podcast/The Daily/3, similar to how folder paths are used in MPD favourites. It's doable but will require quite a lot of changes, and is complicated by the fact that BBC podcasts have their own special logic.

Obviously if the Favourite refers to an episode of a podcast that has been removed then there's nothing we can do, since we won't have the RSS URL to read the episode list, so that should return an error to the user asking them to add the podcast again or delete the favourite.

I think it's still OK to use the integer index for the episode number in the URI, as these are supposed to be immutable.

What do you think? Can you see any simpler solutions?

I'm going to start playing with changing the URI scheme to see how much work there actually is.

from volumio-plugins.

teq0 avatar teq0 commented on June 29, 2024

I've implemented the new URI scheme, with the name instead of index for the second element, and the "on demand" loading of podcast items, it works well, except that the core code calls explodeUri for every item in the Favourites list whenever you click on a single item. This means that if you have episodes from 10 different podcasts in your Favourites then the first time you click on any favourite, podcast or not, it goes and fetches the RSS for every podcast. I added a cache timeout so that it doesn't fetch multiple times for the same podcast, but the user still gets the toaster popups about fetching the content for all of the podcasts.

It's not terrible but it's probably unexpected behaviour for the user.

from volumio-plugins.

ChrisPanda avatar ChrisPanda commented on June 29, 2024

@teq0

Hi, you don't need to change URI scheme and I already fix the problem and it will be pull request to Volumio and the explodeUri has a bug for a favorite function. In addition, I almost finish the podcast directory searching feature and caching podcast items and I'll change RSS parsing library to speed up.

Thanks

from volumio-plugins.

teq0 avatar teq0 commented on June 29, 2024

OK, looks like I wasted a few days of my time then. I assumed from your response on the forum that you were happy for me to work on this and that you were working on the search function.

Curious to see your solution, especially how it handles deleted podcasts while still using a simple integer index in the URI.

from volumio-plugins.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.