Thank you for your donation!


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


Instruction Guide Exporting/Importing Radio Stations
#11
(04-10-2021, 03:49 PM)fdealexa Wrote: Hello Jan,
it is my opinion that the best way to help you is to have the .zip file you have created and, then used for the import.
Best regards,
Francesco

Hi Francesco, please find my stations.zip attached to this post. 
If needed, I still have my 6.7.1 version available on another microSD, so I can re-create the file.
Thx for your help!

.zip   stations.zip (Size: 577.45 KB / Downloads: 23)

@bitlab sorry for not giving credit to the correct person for creating the script, so a big thank you!
offcourse I already tried rebooting several times, and clearing browser cache, tried different browsers, but that doesn't seem to help.
Reply
#12
(04-11-2021, 10:38 AM)janvda Wrote:
(04-10-2021, 03:49 PM)fdealexa Wrote: Hello Jan,
it is my opinion that the best way to help you is to have the .zip file you have created and, then used for the import.
Best regards,
Francesco

Hi Francesco, please find my stations.zip attached to this post. 
If needed, I still have my 6.7.1 version available on another microSD, so I can re-create the file.
Thx for your help!


@bitlab sorry for not giving credit to the correct person for creating the script, so a big thank you!
offcourse I already tried rebooting several times, and clearing browser cache, tried different browsers, but that doesn't seem to help.

Hi Jan,
Found a problem on the .csv file in the line "Nostalgie 60-70". I am trying to repair it and I will send it to you.
Regards,
Francesco
Reply
#13
(04-11-2021, 09:47 PM)fdealexa Wrote:
(04-11-2021, 10:38 AM)janvda Wrote:
(04-10-2021, 03:49 PM)fdealexa Wrote: Hello Jan,
it is my opinion that the best way to help you is to have the .zip file you have created and, then used for the import.
Best regards,
Francesco

Hi Francesco, please find my stations.zip attached to this post. 
If needed, I still have my 6.7.1 version available on another microSD, so I can re-create the file.
Thx for your help!


@bitlab sorry for not giving credit to the correct person for creating the script, so a big thank you!
offcourse I already tried rebooting several times, and clearing browser cache, tried different browsers, but that doesn't seem to help.

Hi Jan,
Found a problem on the .csv file in the line "Nostalgie 60-70". I am trying to repair it and I will send it to you.
Regards,
Francesco

Hello Jan,
Please be informed that the import process of  the "stationmanager" program is complete when the final message of the total number of stations imported is displayed. 
About the error in the .csv file: there is a duplicated record for the "Nostalgie 60-70", one of which with a slash (/) instead of the dash (-) and without the field delimiters (").
In the afternoon I will send to you the correct .zip file.
Regards,
Francesco
Reply
#14
Hi Jan,
as mentioned before, please find attached the .zip files corrected. the total stations imported are 33.
for the second I assume you are using moOde7.1. Of course they are alternative:

stationsGood.zip: it is your original format (from 6.7.1) to be used with the program stationmanager: the application will decode the information and will create the related files on the system.

stationsNew.zip: it is the save after the import phase. ready to use with the program: it contains all the files.

May I suggest that after a import process you do:
  • Update library
  • Refresh
  • Restart.
Before to use the stations (sometimes the logos disappear).

I hope you will import them succesfully and will be happy about it.
Regards,
Francesco

.zip   stationsGood.zip (Size: 577.41 KB / Downloads: 15)    
.zip   stationsNew.zip (Size: 694.48 KB / Downloads: 20)

P.S.: Please let me know if everything is ok
Reply
#15
(04-10-2021, 08:02 PM)TheOldPresbyope Wrote: @janvda

Thanks for the compliment but let's not lose track of the fact that @bitlab wrote the script. All I did was explain how it could be used in stand-alone fashion.

I'm not sure I understand how you got the result you report. Here's hoping bitlab's suggestion clears the air. Smile

Regards,
Kent

@TheOldPresbyope in my opinion you are downplaying your role with the creation of the script haha. 
You did provide a lot of the 'BI' rules behind the script and also did a big part of the testing.
Reply
#16
@fdealexa great catch!
Let see if we can protect against this case on both export and import, or at least continue when this happens.
Reply
#17
@bitlab
Dear "bitlab",
thanks, too good.
I think that the creation of the .csv (in the stationmanager) or the .json (in the moOde UI) is the most critical point in the process of mass import of stations.
My experience (more than 700 user stations) led me to design an Excel sheet for the creation of these files. The ideal would be to use only the set of .pls files (URL and name) and .jpg (only the high resolution: those with the lowest resolutions are already created in the program), if there is no specific need to fill in the additional fields. In this regard, I tried to ask Tim, in the SORTING AND GROUPING functionality, the possibility of having one of the "spare fields" as "Sort tag": what do you think?
For the export process, however, theoretically, if the import is controlled (as it is) there should be no inconsistencies in the databases.
As for the improvement perhaps I would add a message of "no radio station imported" at the end of the script, similar to the "XX radio imported".
that's all.
Greetings and thanks again for asking me (and sorry for my english),
Francesco
Reply
#18
(04-12-2021, 02:52 PM)fdealexa Wrote: Please let me know if everything is ok

Thx for your help, great job!
Reply
#19
@janvda @fdealexa To prevent such situations in the future I updated the stationmanager.py script to instead of abort continue with the next import station. I guess it will be part of moOde 7.2.

@fdealexa
By the way the stations backupzip which contains a .csv aren't created with the stationmanager.py script, but with older moOde stations backup script.
The new backup will always contains the .json file. This is the only way to support the rich information Tim added to the about the station to the database.

When running the import from the web interface you don't see all the output of the stationmanager.
When you run it from command line it will report the import status and errors and.

With the fixed script the error in this case will showup as an 'Error on import':
Code:
sudo ./stationmanager.py --import --scope all --how clear ~/stations_problem.zip
SQL database location is '/var/local/www/db/moode-sqlite3.db'
Station logos location is '/var/local/www/imagesw/radio-logos'
Station pls file location is '/var/lib/mpd/music/RADIO'
Using Station backup file '/home/pi/stations_problem.zip'.
WARNING: Station backup is an old format
import
WARNING: no schema information, guessing moOde 6.7.1 station backup format
WARNING: Source and target differ, correcting used types
Clear stations for scope 'all'
... <cut text> ...
Import Nostalgie 60/70
Error on import: [Errno 2] No such file or directory: '/var/lib/mpd/music/RADIO/Nostalgie 60/70.pls'
Import Nostalgie 80
WARNING: Missing station logo thumb for 'Nostalgie 80', generating one
... <cut text> ...
Imported 35 radio stations
Reply
#20
Importing and exporting personal stations:

From the command line it is also possible to merge (as opposed to flush everything) multiple backups (for the scope other) into moOde.
For example I have a few custom stations from which I have a backup. After a fresh install I only restore those in without deleting the already present one.
In this was I get the latest&greates default radio radio stations from moOde, while I keep my personal stations.

You can create the backup from the web interface or command line with:
Code:
sudo /var/www/command/stationmanager.py --export --scope other ~/stations_mycustom.zip


Because the import on the web interface clears all stations and import all station , we need todo the restore in this case from commandline. 

Restoring of the personal stations with a merge (it doesn't matter if the backup also contains the system station due to --scope other argument):
Code:
sudo /var/www/command/stationmanager.py --import --scope other --how merge ~/stations_mycustom.zip
Reply


Forum Jump: