Thank you for your donation!


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


Official moOde 6.7.1 support thread
Hi Tim, Hi Kent,
unfortunatelly the existing py code (moode-radio-utils) is not running due:
1. the location of the radio-logos and thumbs (change from /var/www/images/ to /var/local/www/imagesw) - no problem I can change them
2. More important: the record definition of db (from 5 fields to 12 fields) - I am not able to modify the code and json.

I am sorry to bring no good news but, please: "ambasciator non porta pena" that means "do not shoot the messenger"
Regards,
Francesco
Reply
This export/import discussion probably should be in its own thread Rolleyes

The whole radio subsystem is a bit of a rabbit hole for me. It keeps trying to mutate from a nice background music source into a full-featured Internet radio which is not how I want to use it.

I wrote my Python routines to help a specific user with a problem. If they have been useful to others, great, but I won't pretend they are production quality. As it says in the README, there's a modicum of error checking. It deals only with user-defined stations. Existing user-defined stations on the destination player are left untouched, stations to be loaded which match existing ones in name are skipped, and "id" values aren't used on input so it's not possible to end up with clashing primary keys. That's it.

In my last test, I doubled both the post_max_size and upload_max_filesize parameters to 60M (in /etc/php/7.3/fpm/php.ini) and rebooted. The 413 error reoccurred. By my calculation, there should be plenty of headroom over the 30MB-32MB base64 sizes of the zip files which failed to upload. I don't get it.

Regards,
Kent
Reply
Those two params plus an nginx.conf param named "client_max_body_size" all have to be set to the given size.

I was able to upload 145M zip file but definitely there needs to be a lower limit for this because uploading "big" files for example >100M would require other checks like for available free space, RAM, etc.

Maybe 50M is a good max upload size?
Enjoy the Music!
moodeaudio.org | Mastodon Feed | GitHub
Reply
Nginx. Now it all starts making sense. 

Seems to me 50MB is as good a choice as any. Certainly not “unlimited”.  Tongue

I’ll try it with the OPs files later.

Regards,
Kent
Reply
(08-21-2020, 05:11 PM)TheOldPresbyope Wrote: This export/import discussion probably should be in its own thread Rolleyes

The whole radio subsystem is a bit of a rabbit hole for me. It keeps trying to mutate from a nice background music source into a full-featured Internet radio which is not how I want to use it.

I wrote my Python routines to help a specific user with a problem. If they have been useful to others, great, but I won't pretend they are production quality. As it says in the README, there's a modicum of error checking. It deals only with user-defined stations. Existing user-defined stations on the destination player are left untouched, stations to be loaded which match existing ones in name are skipped, and "id" values aren't used on input so it's not possible to end up with clashing primary keys. That's it.

In my last test, I doubled both the post_max_size and upload_max_filesize parameters to 60M (in /etc/php/7.3/fpm/php.ini) and rebooted. The 413 error reoccurred. By my calculation, there should be plenty of headroom over the 30MB-32MB base64 sizes of the zip files which failed to upload. I don't get it.

Regards,
Kent


Hi Kent,
I am very sorry if my post has created some doubts: regarding the Python routines (moode-radio-utils), what I meant: the new DB (from 6.6 I guess) has different position and record definition. I tried your two radio list and it doesn't work.
I absolutely do not want to question what you (and all the staff) have created: I would just like to be a help in making Mode better and, of course, the best player.
I apologize for any misunderstandings, please believe me.
Thanks and best regards,

Francesco
Reply
No worries, Francesco!

I was not reacting to your post. I was just expressing my opinion to Tim that moOde needn't bulk up with lots of Internet radio gimmickry. I expressed it clumsily.

Regards,
Kent
Reply
@fdealexa


PS - you're correct. I wrote the code a little over a year ago, just as mooOde 6.0.0 was hitting the street. Since then, the radio-logos directory got moved to /var/local/www/imagesw from its previous position /var/www/images. Sorry and thanks for mentioning it.

I need to update the repo. At a glance it looks like the fix will be simply:

Line 40 in savemyradios.py becomes

Code:
logosrc = '/var/local/www/imagesw/radio-logos/'


Line 39 in loadmyradios.py becomes

Code:
logodest = '/var/local/www/imagesw/radio-logos/'


You can try this now or you can wait 'til I update and test the repo.

Regards,
Kent
Reply
(08-22-2020, 03:11 PM)TheOldPresbyope Wrote: @fdealexa


PS - you're correct. I wrote the code a little over a year ago, just as mooOde 6.0.0 was hitting the street. Since then, the radio-logos directory got moved to /var/local/www/imagesw from its previous position /var/www/images. Sorry and thanks for mentioning it.

I need to update the repo. At a glance it looks like the fix will be simply:

Line 40 in savemyradios.py becomes

Code:
logosrc = '/var/local/www/imagesw/radio-logos/'


Line 39 in loadmyradios.py becomes

Code:
logodest = '/var/local/www/imagesw/radio-logos/'


You can try this now or you can wait 'til I update and test the repo.

Regards,
Kent

Thanks Kent,
I already did this yesterday on my own and the reason for my post was that there is something else in the record definition: 5 fields instead of 12.
I'm repeating it now simply (using your original file) to give you the result:


Code:
pi@moOde-FdA-Salone:~/moode-radio-utils $ sudo ./loadmyradios.py
Load user-defined radio stations from myradios.tar.gz  in the current working directory
Proceed? (y/n): y
adding station 'Grateful Dead Live at Carousel Ballroom - 1968'
Traceback (most recent call last):
 File "./loadmyradios.py", line 98, in <module>
   cur.execute("INSERT INTO cfg_radio VALUES (?,?,?,?,?)", (None, entry['station'], name, entry['type'], entry['logo']))
sqlite3.OperationalError: table cfg_radio has 12 columns but 5 values were supplied
pi@moOde-FdA-Salone:~/moode-radio-utils $
Thanks again and best regards,
Francesco
Reply
@Tim Curtis
@fdealexa

Re: importing radio stations

As expected, bumping the three configuration parameters for php and nginx to 50MB, poking the integrity check in the eye with a sharp stick, and rebooting, I was able to import the two biggest files provided to me. The attached screen capture shows logos of some of the DAB+ stations which were in the last file I imported.

Francesco, I don't recommend you try hand-editing the moOde internals; I'm sure this increase in import file capacity will show up in the next release. There will always be some limit, for the reasons Tim mentioned, but I think 50MB is a reasonable one.

Regards,
Kent


Attached Files Thumbnail(s)
   
Reply
(08-22-2020, 05:42 PM)TheOldPresbyope Wrote: @Tim Curtis
@fdealexa

Re: importing radio stations

As expected, bumping the three configuration parameters for php and nginx to 50MB, poking the integrity check in the eye with a sharp stick, and rebooting, I was able to import the two biggest files provided to me. The attached screen capture shows logos of some of the DAB+ stations which were in the last file I imported.

Francesco, I don't recommend you try hand-editing the moOde internals; I'm sure this increase in import file capacity will show up in the next release. There will always be some limit, for the reasons Tim mentioned, but I think 50MB is a reasonable one.

Regards,
Kent

Thanks Kent.
in the meantime you kindly tell me "what to do" for the parameters, I tried to change your Python code:
changing line 98 of loadmyradios.py, I got the insertion of your two radios.

Code:
cur.execute ("INSERT INTO cfg_radio VALUES (?,?,?,?,?,?,?,?,?,?,?,?)", (None, entry ['station'], name, entry [ 'type'], item ['logo'], None, None, None, None, None, None, None))

Now I'd completely fix it, if you can send me the new record scheme (if you have it).
It probably is

Code:
(id, station, name, type, logo, genre, broadcaster, language, country, region, bitrate, audio format)

Thanks again,
Francesco
Reply


Forum Jump: