Thank you for your donation!


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


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.
Enjoy the Music!
moodeaudio.org | Mastodon Feed | GitHub
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.
Enjoy the Music!
moodeaudio.org | Mastodon Feed | GitHub
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
(08-14-2019, 01:47 PM)TheOldPresbyope Wrote: Those of us who regularly add user-defined radio stations to our moOde players know the pain of having to add them again to fresh installs.

I have written a pair of Python scripts to reduce this pain. They must be executed manually from the command line so the process isn't totally pain-free but it works for me Smile 

See my github repo for details.

The scripts have been tested only with moOde 5.3.1 and moOde 6.0.0 and work with both. 

Regards,
Kent

Hi.

I've got a newbie question.  The script works great but i don't know how to get the resultant file off of the old build.  What's the correct process?

Thank you!
Reply
#19
@gabeg

There's not really one "correct" procedure. Several possibilities come to mind (all but the last presume some proficiency).

1) from the command line, use scp to copy the file across the LAN to a local directory on another computer. This works in Linux, in the Windows Subsystem for Linux, and I assume also in OS X. It's possible to "push" the file to the other computer by running scp on the moOde player or "pull" it from the moOde player by running scp on the other computer, but the sshd daemon must be running on the other computer for the push mode to work.

2) from the command line, first copy (sudo cp) the file to the /mnt/SDCARD directory (which moOde makes available as a Samba share); then from another computer copy the file across the LAN to a local directory using that computer's file manager or whatever app can mount the moOde share. I can even copy it to my cellphone.

3) if one is available, copy the file across the LAN to a NAS using whatever protocol or tools work best.

4) remove the uSD card from the moOde player and plug it into another computer using an uSD-to-USB adapter (in my case, my laptop has a full-sized SD slot so I use the uSD-to-SD adapter which came with the card); from that computer's command line or using its file manager, copy the file to a local directory. If the other computer is a Windows-based host, then likely the file must have been copied to the /boot directory before shutting down moOde because that directory is in the only partition readily visible in Windows.

I usually use #1 but I do a lot of futzing around for other reasons using #4.

Good luck.

Regards,
Kent
Reply
#20
(05-11-2020, 02:11 PM)TheOldPresbyope Wrote: @gabeg

There's not really one "correct" procedure. Several possibilities come to mind (all but the last presume some proficiency).

1) from the command line, use scp to copy the file across the LAN to a local directory on another computer. This works in Linux, in the Windows Subsystem for Linux, and I assume also in OS X. It's possible to "push" the file to the other computer by running scp on the moOde player or "pull" it from the moOde player by running scp on the other computer, but the sshd daemon must be running on the other computer for the push mode to work.

2) from the command line, first copy (sudo cp) the file to the /mnt/SDCARD directory (which moOde makes available as a Samba share); then from another computer copy the file across the LAN to a local directory using that computer's file manager or whatever app can mount the moOde share. I can even copy it to my cellphone.

3) if one is available, copy the file across the LAN to a NAS using whatever protocol or tools work best.

4) remove the uSD card from the moOde player and plug it into another computer using an uSD-to-USB adapter (in my case, my laptop has a full-sized SD slot so I use the uSD-to-SD adapter which came with the card); from that computer's command line or using its file manager, copy the file to a local directory. If the other computer is a Windows-based host, then likely the file must have been copied to the /boot directory before shutting down moOde because that directory is in the only partition readily visible in Windows.

I usually use #1 but I do a lot of futzing around for other reasons using #4.

Good luck.

Regards,
Kent
No 2 seems like my best best....when copying the output to the new moode install, where to i copy the file to?
Reply


Forum Jump: