Hello,
In a development to my other thread: http://forum.madsonic.org/viewtopic.php?f=62&t=1986
I have a sequence of database query commands that update playlists based on date added, "starred" status etc. Unfortunately I have to manually enter these commands in the Madsonic web GUI. Is there any way of automating this, perhaps by using a HSQLDB script, or watchdog event? I've done some digging on SQL forums but have drawn a blank.
I also need to have Madsonic regularly export or backup playlists to the default folders. I can achieve this locally by using the URL: [url]http://myserver.madsonic.org:myport/playlistSettings.view?backupPlaylists[/url]
Is there any way of automating this? I have thought about a shell script with cURL but imagine that I would have login problems.
Thanks in advance!
Automating Madsonic
- Madsonic
- Administrator
- Posts: 984
- Joined: 07 Dec 2012, 03:58
- Has thanked: 1201 times
- Been thanked: 470 times
Re: Automating Madsonic
Hi there,mwpmorris wrote:Hello,
In a development to my other thread: http://forum.madsonic.org/viewtopic.php?f=62&t=1986
I have a sequence of database query commands that update playlists based on date added, "starred" status etc. Unfortunately I have to manually enter these commands in the Madsonic web GUI. Is there any way of automating this, perhaps by using a HSQLDB script, or watchdog event? I've done some digging on SQL forums but have drawn a blank.
I also need to have Madsonic regularly export or backup playlists to the default folders. I can achieve this locally by using the URL: [url]http://myserver.madsonic.org:myport/playlistSettings.view?backupPlaylists[/url]
Is there any way of automating this? I have thought about a shell script with cURL but imagine that I would have login problems.
Thanks in advance!
If you want edit or modify your database you can try SQL Workbench http://www.sql-workbench.net/index.html or RazorSQL https://razorsql.com/ in offline mode.
you can also try this script to automate backup
Code: Select all
::::::::::::::::::::::::::::::
:: Backup Madsonic Playlist ::
::::::::::::::::::::::::::::::
:: edit username/password/serverlink to your need
set username=admin
set password=admin
set serverlink=http://127.0.0.1:4040
:::::::::::::::::::::
set wgetsettings=--spider --no-check-certificate --cookies=on --keep-session-cookies --save-cookies=%temp%\cookie.txt
wget %wgetsettings% --user-agent=Mozilla "%serverlink%/login.view?user=%username%&password=%password%"
wget %wgetsettings% --load-cookies=%temp%\cookie.txt --referer="%serverlink%" "%serverlink%/playlistSettings.view?backupPlaylists"
Best regards,
The Madsonic Team
- These users thanked the author Madsonic for the post:
- Matt Zornig
- Rating: 7.69%
Re: Automating Madsonic
If anyone is interested, I managed to automate the db queries by using cURL:
The authentication method mentioned above did not work for me, so I captured a cookie file using a Chrome plugin and linked to it with cURL.
Code: Select all
curl --cookie /PATH/TO/YOUR/COOKIEFILE.txt -d query="SQL QUERY - URLENCODED" http://path.to.madsonic.server:port/db.view
- These users thanked the author mwpmorris for the post:
- Matt Zornig
- Rating: 7.69%