(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