Thank you for your donation!


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


Problem: moOde 6.5.0 update cron script
#1
Up until 6.5.0 I had a script to automatically update the library using `mpd update` command, but in the new version I see the update is tied to refreshing the thumbnail cache for the albums and I like the idea.

How can I do the same in the shell with a cron line? Is there a php script action for this?
Reply
#2
There is a Web API for submitting a Library Update.

Code:
http://moode/command/?cmd=libupd-submit.php
Enjoy the Music!
moodeaudio.org | Mastodon Feed | GitHub
Reply
#3
Great! Thanks a lot.
Reply
#4
Only I just realized that it won't work, because it's running remotely and I don't get a status for it - only if I check with `mpc status`, which is a bit too much for a simple task.

@Tim Curtis would I break anything if I just run `mpc --wait update`? I usually did this to be able to get an exit code from the command and check if the status is OK.
Reply
#5
From SSH you can use the command below.

Code:
sudo /var/www/libupd-submit.php
Enjoy the Music!
moodeaudio.org | Mastodon Feed | GitHub
Reply
#6
(04-27-2020, 12:43 PM)Tim Curtis Wrote: From SSH you can use the command below.

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

Yes, but it's the same as for the API request: I can't get an exit code to know the status of the update.
Reply
#7
What do you mean by "status of the update" ?

When a library update is submitted, MPD update and the thumbnail generator are started in parallel. They may each finish at different times. The visibility of the progress spinner is tied to only the MPD update process. When that process completes, the spinner is hidden.
Enjoy the Music!
moodeaudio.org | Mastodon Feed | GitHub
Reply
#8
(04-28-2020, 09:29 AM)radu- Wrote:
(04-27-2020, 12:43 PM)Tim Curtis Wrote: From SSH you can use the command below.

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

Yes, but it's the same as for the API request: I can't get an exit code to know the status of the update.

You could write a shell script that uses command-line tools instead of the php script, but I don't see the point myself when a cronjob could run the php script.
I have one I wrote but it doesn't do the cover update, it does the mpd db update and clears the tag cache. Would you like me to share as a starting point?
Reply
#9
Haha.. No, this is not a problem. As I mentioned before, I already have a script that uses 'mpc update --wait' and it's fine with me, but thumbnails for new albums are not created in this case, so I wanted to try the new 'method'. Only that I can't have a status after running the php script and this is the problem.

Why do I want the status? Because I had issues sometimes where the update wouldn't finish because of permission or other kinds of problems. It's just a petty thing for me - I can live without it, but it would be nice to have.
Reply


Forum Jump: