-
Notifications
You must be signed in to change notification settings - Fork 20
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
Support non-native (e.g. iTunes) LMS playlists #111
Comments
Ok, update here. Playlists I created in LMS also don't work, so I think the playlist functionality is broken in squeeze-alexa. My python is pretty basic, but I think I've traced this problem to the way that Squeeze-Alexa is implementing the LMS CLI command to play playlists:
In the past when I've been sending LMS CLI commands relating to playlists, I noticed that What I've ended up using is the I'd make this change myself, but it appears that squeeze-alexa uses the same command to play songs as playlists and I don't really know python well enough to make the changes without messing things up at this point. I might have to invest in learning python to debug this, but help to separate out the commands to execute playing songs vs playlists would be very helpful! |
@htcheng thanks for investigating. Nice setup too! I can't replicate the problem, playing playlists works fine here. Are they particularly large (though I don't see why this would make any difference)? What path are your LMS audio files kept at? Can you post some logs from Cloudwatch, taking out anything sensitive e.g. passwords or IPs? |
Thanks for the quick response! I tested again with an LMS created playlist vs iTunes imported playlist and you're right, it does work. I've attached the Cloudwatch logs below - but that's not the source of the error. I've found the error is related to how LMS stores iTunes imported playlists in the database not as a playlist file like other LMS playlists. See the CLI console query below - there is no URL associated with iTunes playlists (just "itunesplaylist:[name of playlist]", so that's why they are empty! I noticed that the LMS UI interface does play the playlists and the UI uses the "playlistcontrol cmd:load" command to load these playlists... so this explains the behavior. The LMS created playlist I created is named "Test" and this playlist has a URL associated with it that points to a local .m3u file -- this works with your existing code. The solution is to separate out the handling of playlists and use the 'playlistcontrol' CLI command to load playlists rather than 'playlist play' - this command works with both LMS playlists and iTunes imported playlists. Why Logitech implemented the commands differently makes no sense... This doesn't look like that difficult of a change -- if only I knew python! I think it's time to start learning python, but I'm a little short on time right now, so help is appreciated here to fix this. playlists 0 255 tags:u |
@declension - so I took a more careful look at the code and with my limited python skills, I think I've figured out a solution. I saw that instead of using the playlist_play function, you actually were calling playlist_resume and feeding in the name of the playlist. So I added a function called playlistcontrol_load in squeezebox/server.py which utilized the other method of loading playlists in the CLI:
and modified line 303 in main.py to call playlistcontrol_load instead of playlist_resume:
and Voila! Alexa now plays both LMS created playlists and iTunes imported playlists using squeeze-alexa... I'd submit a pull request if I knew how, but given that I only changed a very few lines of code - this should be easy to test and incorporate. Seems to solve my problem without breaking anything... Hope this helps. |
@htcheng thanks for that. I'm still not sure why Furthermore from your LMS logs above I see, assuming they're unprocessed, that the URLs being passed around are not properly URL encoded: e.g. I've borrowed those playlist names for a test (let me know if that's a problem!) and can confirm squeeze-alexa only parses the bit before the space (as designed). This would explain why those playlists are never playing (your recent tests above are all single-word playlists, so would not be affected by this). |
My apologies, in the LMS logs above I removed some of the URL encoding to make it more human-readable, but rest-assured the names are URL encoded when they come back from the LMS server and do work with squeeze-alexa - except some of the longer compound ones like "Charles Classical Short" playlist get interpreted as "Classical" playlist, so I will have to change some of the names of the playlists to ones that are clearer. "90's Music" playlist does get interpreted correctly though Alexa calls it "90 (ess) Music" playlist As for BTW, the |
Ah right. Though I guess as you say the problem is that those original commands expect a native playlist / playlist file on disk as they predate LMS plugins providing their own schemes for playable URLs / playlists. I'll look into moving to the |
Not sure if anyone else is having this issue, but I have LMS running on my Synology NAS and it imports all of the music and playlists from an iTunes directory which I have sync'd via Syncthing with an iMac that my kids use to load/manage all of their music via iTunes. Allows them to use iTunes as a UI and master library and have the NAS keep a live copy (we also back up the iMac using Time Machine just in case).
LMS automatically updates when changes are detected in the directory and both iTunes and LMS have the same music and playlists. Playlists created on the iMac in iTunes are automatically imported into LMS and can then be used across all of the Squeezebox Booms, Touches, Radios, piCorePlayers, etc. in the house. Everything works perfectly and everyone is happy...
I've gotten Squeeze-Alexa working as well and we can control LMS via Alexa perfectly EXCEPT for some weird reason, when we request to Alex to play any of the playlists that are imported from iTunes (and work pefectly when selected in the LMS web UI), Alexa understands the command and performs the command on LMS, but the resulting playlist is empty every time no matter how large or small the playlist is. I still need to test whether playlists that are created within LMS work or not, but has anyone else come across this issue?
The text was updated successfully, but these errors were encountered: