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

Fixes #155 by enabling to start an update by running php update.php #170

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

tomchiverton
Copy link
Contributor

I'm currently getting

PHP Fatal error:  Uncaught Error: Call to a member function analyze() on null in /tmp/update.php:820
Stack trace:
#0 /tmp/update.php(608): fileStructure('/exports/mp3/Al...', Array, Array, 'h1e9ld8x9q', '1650293688')
#1 /tmp/update.php(522): recursiveScan('/exports/mp3/Al...')
#2 /tmp/update.php(522): recursiveScan('/exports/mp3/Al...')
#3 /tmp/update.php(372): recursiveScan('/exports/mp3/')
#4 /tmp/update.php(101): update_impl('/exports/mp3/')
#5 /tmp/update.php(81): cliUpdate()

but think this is a bad file in my collection

@tomchiverton
Copy link
Contributor Author

Think fixed that, log file ends up with

Update stop time: 20240908 15:11:26

@ArturSierzant
Copy link
Owner

Thanks for your effort and sorry for long time to answer to your posts.
I took a look at your code and modified it a little bit so it doesn't display HTML code in CLI. Unfortunately I can't push it to GitHub, I don't know why. I'll try tomorrow.

@ArturSierzant
Copy link
Owner

OK, I pushed my changes to new branch pr/n170_autoupdate. Please take a look. I think your idea is good, so please feel free to go on with this. First I would add passing dir to update as an argument in cli:
php update.php /path/to/dir/to/be/updated
Next step would be an error handling with messages shown in cli.

@tomchiverton
Copy link
Contributor Author

Update changes in #171

I'm not sure how to recover from the error inside the catch block - I think we should do what ever the magic "cancel" click does on the web GUI but I am unsure where that code lives.

@ArturSierzant
Copy link
Owner

Code that do magic :) is here:
https://github.com/ArturSierzant/OMPD/blob/9d1ecd44116d000cb8cd4146b3b7ffe688dd50e5/config.php#L244C2-L265C3
Basically it resets some values in database to allow next update and to prevent erasing data.

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

Successfully merging this pull request may close these issues.

2 participants