Thank you for your donation!


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


Solved: Update library automatically?
#1
For the more tech savvy people, is there a way to run a library update from a script? I would like to be able to update my library when a beet import finishes. Updating mpd library isn't feasible, because I would like to have the album covers/thumbnails updated too.
Reply
#2
The command below will submit a Library update remotely.

Code:
http://moode/command/?cmd=libupd-submit.php

ETA: From a BASH script.

Code:
$(curl -G -S -s --data-urlencode "cmd=libupd-submit.php" http://moode/command/)
Enjoy the Music!
moodeaudio.org | Mastodon Feed | GitHub
Reply
#3
Great! Thanks a lot Tim!
Reply
#4
Sorry to tag on, but I use a bash script to update the library, that I call on from my PC:

#!/bin/bash
echo "Going to update the moOde library"
mpc update
sleep 5
exit

Reading the above, am I correct in assuming that this does not update the album covers? Should I substitute "mpc update" with "libupd-submit.php"?

P.S. I do the above, because update the library through not work on my browser(s). But I don't mind that.
Reply
#5
Correct, a plain "mpc update" does not update the thumbnails.

Try

Code:
sudo /var/www/libupd-submit.php
Enjoy the Music!
moodeaudio.org | Mastodon Feed | GitHub
Reply
#6
Thanks Tim,

That's very helpful. Of course, it works!
Reply
#7
(09-11-2021, 12:53 AM)Tim Curtis Wrote: Correct, a plain "mpc update" does not update the thumbnails.

Try

Code:
sudo /var/www/libupd-submit.php

Is it possible to update only a folder?
Reply
#8
Yes but you would need to modify the PHP script /var/www/libupd-submit.php to accept a folder path as a command line argument. The folder path would need to be relative to MPD music root. Something like that.
Enjoy the Music!
moodeaudio.org | Mastodon Feed | GitHub
Reply
#9
OK, I see. Thanks, Tim. I think I'll use as is, because I don't want to mess with patches on every update/upgrade.
Reply


Forum Jump: