Navigation Menu

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

Add TuneIn radio initial support #156

Merged
merged 16 commits into from Mar 12, 2018
Merged

Conversation

piffio
Copy link
Contributor

@piffio piffio commented Mar 5, 2018

This plugins adds support to TuneIn Radio streams and Podcasts.

This is my first Volumio plugin, therefore feedback is more than welcome.
The initial release is meant at providing a basic working functionality and to get early testing. I have been testing thoroughly both radio stations and podcasts, but I expect some users will get into special corner cases.

The plugin caches results from TuneIn, to avoid being blacklisted.
Ideally we should get a dedicated partnerId from TuneIn, which would increase the request quota as well as enable support for authentication and other additional features, but so far I have got no replies to my emails :(

What is supported:

  • Browsing and playing Radio Stations
  • Browsing and playing Podcasts (Shows)
  • Searching for content

What is not supported (yet?):

  • Login to your personal account, and all the features that depend on this capability (namely the ability to access your favorite TuneIn streams from Volumio)

Create the very first bits of a TuneIn Radio plugin for Volumio.
So far it simply downloads and shows the list of available categories
from TuneIn Radio.
Everything else is still to be done.
Add initial (and very unclean) support for playing a radio.
The "Local Radio" section now supports playing radios correctly.
Significant changes in the browsing logic, including:
* Load root categories during the onStart() call, and cache results
  for a faster browsing
* Use regexp matches to identify the 1st level of nested browsing
* Generalise the former browseLocal() function to be able to handle
  most of L1 browsing, covering Local radios, Talk, Music and Sport
* Fix the "prev" link
Start migrating the codebase to use node-tunein-radio instead
of node-tunein, which is being designed with the specific
purpose of supporting the required use-cases for this
Volumio plugin.
The browsing logic had to be reviewed after switching to the new
node-tunein-radio npm module.
All main categories are now working when it comes to browsing their
main content.
It looks like `albumart` needs to be used for thumbnais instead of
`icon`, which is used for folder icons instead.
Implement search through TuneIn content
* Add support for 2 meta categories (Best and Popular) via configuration switches.
* Break down items in each list by sub-categories
Track the history of browsing across different nested levels in
order to provide a more consistent behavior when pushing the
"back" button.
* Use the parsed URL from API calls to set internal routing URLs, which
  makes the whole logic much more generic

* De-duplicate code by moving common bits into a function that will assemble
  the proper item to be added to the result sets
Since TuineIn uses an undefined number of nested levels with filters
and so on, we need to take a generi approach while browsing for
content, and trust the results from API without trying to
over interpret.
The API uses uppercase characters and the ~ sign is some filters
(Namely when paginating by first letter).
* Make the existing entries in UIConfig more self-explanatory.
* Add a new flag for enabling/disabling experimental features to
  make sure people are clear on what they get.
* Hide "Podcasts" behind the experimental flag.
Leverage the ability of the node-tunein-radio module to cache results.
Given that the contend doesn't change so often, cache results for
one hour.
Now it's possible to browse Podcasts / Shows episodes and play
them properly.
@piffio
Copy link
Contributor Author

piffio commented Mar 9, 2018

@volumio is there anything else I need to do in order to get this PR reviewed?
Just let me know in case anything is missing

@volumio
Copy link
Owner

volumio commented Mar 12, 2018

Hi Sergio,
actually I think your work is awesome!
I was also thinking, why not integrate it directly into Volumio itself, rather than a plugin? Would you be open to that?

@piffio
Copy link
Contributor Author

piffio commented Mar 12, 2018

Honestly, I though about it halfway through the implementation when I noticed the similarities with the embedded webradio code, but I still felt the right way to submit a new standalone feature would be through a plugin.

What I would suggest is a 2 steps approach:

  • Unless you see any blocker, I'd suggest moving on an publishing the plugin. This will deliver the feature to all those users who have been waiting for it, and will provide some early testing and possibly bug reports to cover for some non trivial corner cases
  • While the plugin matures I can work on a structured PR for the Volumio repo to eventually replace it.

Would that work?

In that case I'll open an issue soon on the Volumio repo to discuss some details about the implementation. Namely, I am unsure about how much to integrate TuneIn within the webradio section.

@volumio
Copy link
Owner

volumio commented Mar 12, 2018

Hi Sergio,
that's a good plan, let's go with this 2 steps approach. I'll review and merge asap

@volumio volumio merged commit a5a13ba into volumio:master Mar 12, 2018
@volumio
Copy link
Owner

volumio commented Mar 12, 2018

@piffio Plugin published, very well done!
I've made few cosmetics tweaks:

  • Icon is now same size as the others
  • Configured proper category ( so the 3 dots are not showed on categories)
  • Added icons to top level

That's definetely a great start, looking forward to see your improvements !
Ciao a presto!

@piffio piffio deleted the tunein_radio branch March 17, 2018 13:46
ashthespy pushed a commit to ashthespy/volumio-plugins that referenced this pull request Apr 9, 2018
Proper volatile setup, that doesn't break Volspotconnect2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants