Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

auto-update of media #155

Open
surtarso opened this issue Apr 19, 2022 · 7 comments
Open

auto-update of media #155

surtarso opened this issue Apr 19, 2022 · 7 comments

Comments

@surtarso
Copy link

Hi there again, still having a blast with O!MPD! tyvm

Is there a way I can automate my library update? An option, watchdog, cronjob w/e it takes, without breaking anything hehe
I have Lidarr constantly updating my library, so every now and then some files are replaced or new albums arrive. I dont think a real time watchdog would be nice on my pi, but some late night cron or auto-update feature would be awesome.

Not sure if its already there, the way I do it it just to manually update the library on settings when I feel enough has changed in the music directory (bout every week or so...)

thanks!

@ArturSierzant
Copy link
Owner

Update DB from command line is on TODO list, but I can't tell you when it will be done...

@tomchiverton
Copy link
Contributor

Where in the code does o!mpd do it's updates ? It seems like it'd be simple to write a command line PHP script to call it ?

@ArturSierzant
Copy link
Owner

Update is in update.php file, function update().

@tomchiverton
Copy link
Contributor

Cool.

So we'd have to move everything after require('include/footer.inc.php'); from update() to some other function (updateImpl() ?)

Then call that from a new updateCli() what has some basic command line parsing to fill in dir_to_update ?

@ArturSierzant
Copy link
Owner

I would add a new function to update.php - actually there is a leftover called cliUpdate() in that file. This function would contain more or less the same functions as update() but without HTML parts.

@tomchiverton
Copy link
Contributor

Right, but if I do that, and some of the SQL in update() changes, it'd have to be changed in two places.

It's a little more work for me to make update() output just the HTML and then call updateImpl(), but then I can make cliUpdate() just call updateImpl().

It's propbably a clearer separation that way anyway, even without a command line method to update ?

@tomchiverton
Copy link
Contributor

tomchiverton commented Sep 8, 2024

!170 so far has the above approach in, but not changes to the output of HTML by the update function php update.php >/dev/null overcomes this.

If you think this is the right idea, I can work on cutting down the output when the (preexisting) cfg['cli_update'] is true ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants