Thank you for your donation!


Bulk saving/loading user-defined radio stations
#11
(08-21-2019, 10:17 PM)Im bored Wrote:
(08-21-2019, 09:19 PM)Tim Curtis Wrote: When you manually add your stations do you also update the cfg_radio table?

When I manually add radio stations I update them in the interface by pressing the refresh buttons.
And If that doesn't work I go to config and Update MPD database.

Is that what you mean?

I was asking whether your process of bulk adding radio stations includes a step where you update the cfg_radio table. If you update the table please post the sqlite command string.
Reply
#12
(08-21-2019, 10:51 PM)TheOldPresbyope Wrote: @Im bored

I'm a bit lost here.

You said:
Quote:1. Update to 6.10 via ISO
2. go through and setup manually
3. manually add radio stations and images


What exactly did you do in step 3? 

For each station, did you use the "+" icon in the Radio Directory to open the "New Station" popup and in it enter your station name, URL, Logo, and then hit the "Create" button?  This creates the database entry and the .pls file and copies in the .jpg files.

The "Refresh" button does not enter stations but it does scan the .pls file directory. If you've added your own .pls files to the /var/lib/mpd/music/RADIO directoy and .jpg files to the /var/www/images/radio-logos and ../thumbs directories, then they will show up in the UI after the refresh. However, they will not automagically be entered into the database and my script will not know of their existence. That's spelled out in the comment block at the head of each script.

I don't understand also why you did all this on one moOde player. The point is to be able to save stations which have been created on one player and load them onto others.

As an aside, I can see I made a mistake adding my example tar file. I'll have to modify the repo to hide it in a subdirectory to avoid unnecessary confusion. Also, I need to check savemyradios.py to make sure it doesn't create a tar file if it will be empty.

Regards,
Kent

I originally had 5.3.1 setup and when I moved to 6.1.0 I manually moved my radio stations. Meaning Copy and paste directly into the folder. I currently have 260+ stations so hitting the + every time is not an option. 

The reason I did what I did to one unit was to run a test. It was purely for test purposes.

So the lest step I do is Update MPD database or Re Generate MPD database, doesn't that update the database you are referring to?

I'm sorry if I'm confusing you guys, but I do appreciate yours and Tim's support
Reply
#13
(08-21-2019, 10:59 PM)Tim Curtis Wrote: I was asking whether your process of bulk adding radio stations includes a step where you update the cfg_radio table. If you update the table please post the sqlite command string.


No I don't run any commands after adding radio statons to update cfg_radio table.

My process is
Copy and Paste Radio stations to /var/lib/mpd/music/RADIO
Copy and Paste Images to /var/www/images/radio-logos

Navigate to the User Interface and refresh there so the stations show up in the UI.

That's it.
Reply
#14
(08-21-2019, 11:19 PM)Im bored Wrote:
(08-21-2019, 10:59 PM)Tim Curtis Wrote: I was asking whether your process of bulk adding radio stations includes a step where you update the cfg_radio table. If you update the table please post the sqlite command string.


No I don't run any commands after adding radio statons to update cfg_radio table.

My process is
Copy and Paste Radio stations to /var/lib/mpd/music/RADIO
Copy and Paste Images to /var/www/images/radio-logos

Navigate to the User Interface and refresh there so the stations show up in the UI.

That's it.

Nope, as I explained in my previous message, that's circumventing the logic implemented in moOde's interface and mirrored in my scripts. 

Sorry.

Regards,
Kent

Post script: if you have all your .pls files and .jpg files (did you generate all the thumbnail files yourself?) then you can write a script to scan them and create the sqlite3 entries to populate the database.
Reply
#15
(08-21-2019, 11:48 PM)TheOldPresbyope Wrote: Nope, as I explained in my previous message, that's circumventing the logic implemented in moOde's interface and mirrored in my scripts. 

Sorry.

Regards,
Kent

Post script: if you have all your .pls files and .jpg files (did you generate all the thumbnail files yourself?) then you can write a script to scan them and create the sqlite3 entries to populate the database.

The thumbnails were created when I originally entered each station one by one using the interface +. And there after I copied and paste the entire radio-logos and RADIO folder which included the thumbnails that were previously created by Moode Player.
Reply
#16
I see.

The cfg_radio SQL table is what enables moOde to display the station logo when MPD initiates playback. This table is needed because MPD only carries the station URL in its Playlist and not the path to the .pls file.

Since there are no entries for your stations in in cfg_radio in the new 6 image, Kent's scripts won't do anything.

I suppose once a save/restore stations feature is integrated into moOde this won't be a problem.
Reply
#17
Ok, so the github repo has been updated to 1) not write an empty .tar.gz file in the case that no station is saved (specifically because the only entries found in the database have no corresponding .pls file) and 2) add more information and examples to the README file.

Regards,
Kent
Reply
#18
I'd like to have a crack at creating a package manager for stations and store the .pls files on git. The BBC Five Live station URL in the default install seems to have stopped working.
--

GitHub : @duracell80
Spotify : @duracell80
Reply


Forum Jump: