03-31-2019, 09:28 PM
Nice :-)
Prolly something like below to determine whether squeezelite is active. The variable squeezelite_active will have the value '1' if squeezelite is active and '0' if it's not.
To load and play individual radio stations or playlists its something like below
Prolly something like below to determine whether squeezelite is active. The variable squeezelite_active will have the value '1' if squeezelite is active and '0' if it's not.
Code:
import time
import datetime
import sqlite3
db = sqlite3.connect('/var/local/www/db/moode-sqlite3.db')
db.row_factory = sqlite3.Row
db.text_factory = str
cursor = db.cursor()
cursor.execute("SELECT value FROM cfg_system WHERE param='slactive'")
row = cursor.fetchone()
squeezelite_active = row['value']
print str(datetime.datetime.now())[:19] + ' squeezelite_active = ' + squeezelite_active
To load and play individual radio stations or playlists its something like below
Code:
mpc clear
sudo mpc load "RADIO/Amys FM (320K).pls"
mpc play
-- or --
mpc clear
mpc load Favorites
mpc play