Thank you for your donation!


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


Solved: Radio Zombie Station
#1
After I gave up to connect my NAS Files in any way (no mor ideas) I created a new problem by adding a radio station wich has a / in the name I gave to it, obviously that doesn't work. Now I have soemthing like a zombie in my radio list. The name shos up on the list, with a broken image sign. It doesn't play and when I try to edit it shows only empty fields, exept the name (only the part behind the /) 

If I change it to something else, it doesn't save it. If I try to add the station again with a different name, I get a warnig, that this url is already in the database.

I can't delete the zombie. 

I exported the radio stations, and tried to edit the cfg_radio.csv with notepad++ but when I zip everything to stations.zip and re import it, I get a missmatch error. I tried to find that file via ssh (with low knwowledge) but failed.

So I am running out of ideas. Any help would be appreciated
(excuse my english)
Georg
Reply
#2
(02-20-2021, 10:55 PM)gekow Wrote: After I gave up to connect my NAS Files in any way (no mor ideas) I created a new problem by adding a radio station wich has a / in the name I gave to it, obviously that doesn't work. Now I have soemthing like a zombie in my radio list. The name shos up on the list, with a broken image sign. It doesn't play and when I try to edit it shows only empty fields, exept the name (only the part behind the /) 

If I change it to something else, it doesn't save it. If I try to add the station again with a different name, I get a warnig, that this url is already in the database.

I can't delete the zombie. 

I exported the radio stations, and tried to edit the cfg_radio.csv with notepad++ but when I zip everything to stations.zip and re import it, I get a missmatch error. I tried to find that file via ssh (with low knwowledge) but failed.

So I am running out of ideas. Any help would be appreciated
(excuse my english)
Georg


OK, so first and foremost there is a database entry which has to be deleted.

NOTE: in the following code boxes I show expected command-line prompts such as "pi@moode:~ $ "or "sqlite> ". You do not enter these characters but only what comes after them.

Log into the command line on your moOde player as user pi. You'll use an ssh client on some other host or the Web SSH Terminal available via the moOde System Config panel.

Create a backup of the database file so you have a way back if something goes wrong (ETA: this should be entered as all one line. In my browser it is folded into two lines.)

Code:
pi@moode:~ $ sudo cp /var/local/www/db/moode-sqlite3.db /var/local/www/db/moode-sqlite3.db.backup


Open the database using the sqlite3 database client:

Code:
pi@moode:~ $ sudo sqlite3 /var/local/www/db/moode-sqlite3.db


At this point you should have seen a couple of lines of output like

Code:
pi@moode:~ $ sudo sqlite3 /var/local/www/db/moode-sqlite3.db
SQLite version 3.27.2 2019-02-25 16:06:06
Enter ".help" for usage hints.
sqlite>

Ask to see all the radio station entries you have entered so far:

Code:
sqlite> select * from cfg_radio where id > 499;

You should see something like the following:

Code:
sqlite> select * from cfg_radio where id > 499;
500|http://streams.radiomast.io/radioblues-flac|Radio BluesFlac|r|local||||||||No||
501|http://ingest-ams.radiomast.io/tmefolk|TMEFolk Radio|r|local||||||||No||
sqlite>

Find the entry you want to remove. Let's say it's the #500 entry above for station Radio BluesFlac. Delete it:

Code:
sqlite> delete from cfg_radio where ID = 500;

Exit the database (Warning: that leading dot in .exit is essential):

Code:
sqlite> .exit
pi@moode:~ $

At this point you should be able to go back to the WebUI and, in the Library > Radio view, use the refresh function and see that the station is no longer present.

Obviously if you have good sqlite3 skills you could edit the station entry instead of delete it but I counsel against it.

What's left? Well, there will be an orphan .pls file in the mpd directory with a name related to the database entry you deleted. To continue my example,

Code:
pi@moode:~ $ ls /var/lib/mpd/music/RADIO/Radio\ BluesFlac*
'/var/lib/mpd/music/RADIO/Radio BluesFlac.pls'


This file should be deleted (but it doesn't do much harm if it stays):

Code:
pi@moode:~ $ sudo rm '/var/lib/mpd/music/RADIO/Radio BluesFlac.pls'


Similarly, there might be an orphan image file in the radio-logos directory (and related thumb files in the radio-logos/thumbs directory) but from what you said it sounds like you never got an image uploaded for your station. To continue my example:

Code:
pi@moode:~ $ ls /var/local/www/imagesw/radio-logos/Radio\ BluesFlac*
'/var/local/www/imagesw/radio-logos/Radio BluesFlac.jpg'
pi@moode:~ $ rm '/var/local/www/imagesw/radio-logos/Radio BluesFlac.jpg'


and similarly for /var/local/www/imagesw/radio-logos/thumbs

Good luck.

Regards,
Kent
Reply
#3
Hello Kent,
thank you very much for this extensive explanation, it worked, of course.
Please allow me a question, is my assumption correct, that the station name caused the problem? It was like: "Radio Station / Reggae"

Regards,
Georg
Reply
#4
(02-21-2021, 10:12 AM)gekow Wrote: Hello Kent,
thank you very much for this extensive explanation, it worked, of course.
Please allow me a question, is my assumption correct, that the station name caused the problem? It was like: "Radio Station / Reggae"

Regards,
Georg

Hi, Georg.

Yes, the forward solidus (aka forward slash) is the problem. The way moOde stores the playlist (.pls) file and the logo (.jpg) files, this character is interpreted as indicating a level in the Linux file system. Here's the moode.log output I get when I create a station using your example "Radio Station / Reggae":

Code:
20210221 095158 worker: Job setlogoimage
20210221 095158 setlogoimage: error 4b: imagejpeg()/var/local/www/imagesw/radio-logos/__tmp__Radio station / Reggae.jpg
20210221 095159 moode.php: file create failed on /var/lib/mpd/music/RADIO/Radio station / Reggae.pls

Regards,
Kent
Reply
#5
PS - I'm sorry to hear you still haven't been able to mount your NAS in moOde. I was hoping "no news is good news". Let's restart your conversation in a fresh thread with a title something like "can't mount my Synology NAS" so we aren't talking apples (radio stations) and oranges (NAS) Smile

And please go back to your first "Radio Zombie Station" post and use the "Full Edit" function to change the prefix to "Solved" and finally click "Update Post".
 
Regards,
Kent
Reply


Forum Jump: