Thank you for your donation!


Cloudsmith graciously provides open-source package management and distribution for our project.


How to get current playing radio station with from cli or api
#1
UPDATE - 

 I should not have posted this as a problem. 

 I have found that mpc prev may suffice in what I am trying to accomplish. I thought I needed the "name" of the item playing. 

 

Hi,

 I have been using Moode for a few years now and love it. I have multiple moode players in my home to provide zoned audio.


I am trying to solve a problem - I want to get the current playing item - could be a playlist or radio station via cli or api.

I see the ways via the command api - cmd/vol.sh etc... 

What I am trying to do is interrupt the current playing item. Play something else and then go back to what was playing. 

I have tried mpc/mpc status but it just gives a song name when a radio station is playing. I am not sure how to go about getting the current radio station etc...

thank you in advance.
Reply
#2
The Queue position of the previously played item (song or radio station) is stored in a SQL column. You can play it via MPC command. See example below.

Code:
# Assume item 43 is currently playing item and item 37 was previously played item,

pi@rp1:~ $ moodeutl -q "select value from cfg_system where param='toggle_songid'"
37

pi@rp1:~ $ mpc play 37
Mission Control: Celebrating NASA and space explorers everywhere. [SomaFM]: LAD - Inertia
[playing] #37/48   0:00/0:00 (0%)
volume: 15%   repeat: off   random: off   single: off   consume: off

pi@rp1:~ $ moodeutl -q "select value from cfg_system where param='toggle_songid'"
43
Enjoy the Music!
moodeaudio.org | Mastodon Feed | GitHub
Reply
#3
Thumbs Up 
(04-27-2021, 09:31 PM)Tim Curtis Wrote: The Queue position of the previously played item (song or radio station) is stored in a SQL column. You can play it via MPC command. See example below.

Code:
Thank you so much - exactly what I was looking for.
Reply


Forum Jump: