Closed michaelherger closed 9 years ago
Thanks Michael for the huge refactoring. It's at the same time fantastic but killing me as well :-). I'm so bad at Perl +LMS that it will take me a few days to understand all the modifications you've done while I was up-to-date with Triode's version. Don't get me wrong, this is really great, was much needed and could never have done it by myself... just a few extra headaches to come !
It's worth the effort, trust me :-P. The code imho is much cleaner, and easier to be re-used in other ways. Eg. the youtubechannel:// protocol handler you'd like to implement would call the same abstract API search call as in other places.
One more thing: don't try to understand change by change. Don't try to read the diff. It's basically a re-write of the navigation, there are too many changes. Just read the new code. I know, all those callbacks can be confusing. But once you've understood how the new code works, you won't bother reading the diff again.
I absolutely agree, and I will go through it, have no doubt ! One thing, I ran into an error that was already in my code. The region code cannot be a language code (works in some places like FR, but when language code is EN, it fails. Is there an API to get country vs language in LMS ?
No, country is not known in LMS at all.
yes, I've already ditched the whole old files. I'll understand firs the basic video search with the callback structure and then will expand from that. At least, I know what is the "intention" of the plugin where when I started I had no idea at all and that was a real nightmare, on top of the HTTPS and Perl inheritance system that was not clear to me
okay, for Country then it will be manual I dont' want to offend my UK friends or US friends :-)
You could have some reasonable default value per language, then let the user change it in the prefs. Eg. EN -> US, DE -> DE.
Are you Canadian or French?
French if I set EN-US, all the British community of LMS users are going to kill me - and they are many
that would be my last contribution to LMS
Although I'm still dreaming of Sonos synchro and bring back Rapshody (AES) to legacy devices, as we discussed a while ago, plus Amazon Echo integration and a nice 3D printed box for a Pi + screen
The code is supposed to be two letters only: "The regionCode parameter instructs the API to return search results for the specified country. The parameter value is an ISO 3166-1 alpha-2 country code."
oh well I'll import the table and make some deduction, alphabetical order
wil let these as param anyway with the changes you've made, a channel can be a favorite as well ?
there is nothing LMS can query from the computer ? or perl ?
No, I haven't implemented a protocol handler for channels (see the forum thread)
like locale::country
I really wouldn't worry too much about the country. Really only do a mapping for the language codes which don't exist as a country. Most US users probably wouldn't see any difference if they were served EN results. And if they notice, then this probably teaches them a lesson :-)
that would be UK for result, no ? For the favorite, understood and I guess it will be easy after the work you have done
so thanks again, its getting awfully late for me as I've traveled east to west, so double trouble
Hi Philippe,
here's my suggested refactor of all things Youtube API interaction:
Have fun :-)