Moode Forum
[SOLVED] Update library automatically? - Printable Version

+- Moode Forum (https://moodeaudio.org/forum)
+-- Forum: moOde audio player (https://moodeaudio.org/forum/forumdisplay.php?fid=3)
+--- Forum: Support (https://moodeaudio.org/forum/forumdisplay.php?fid=7)
+--- Thread: [SOLVED] Update library automatically? (/showthread.php?tid=4193)



Update library automatically? - radu- - 09-09-2021

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.


RE: Update library automatically? - Tim Curtis - 09-09-2021

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/)



RE: Update library automatically? - radu- - 09-10-2021

Great! Thanks a lot Tim!


RE: Update library automatically? - Woodroww - 09-10-2021

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.


RE: Update library automatically? - Tim Curtis - 09-11-2021

Correct, a plain "mpc update" does not update the thumbnails.

Try

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



RE: Update library automatically? - Woodroww - 09-11-2021

Thanks Tim,

That's very helpful. Of course, it works!


RE: Update library automatically? - radu- - 09-15-2021

(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?


RE: Update library automatically? - Tim Curtis - 09-15-2021

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.


RE: Update library automatically? - radu- - 09-16-2021

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.