YunoHost-Apps / navidrome_ynh

Navidrome package for YunoHost
https://www.navidrome.org/
GNU General Public License v3.0
17 stars 4 forks source link

How to run navidrome CLI commands? #6

Closed SpencerDub closed 3 years ago

SpencerDub commented 3 years ago

Okay, real basic question here, sorry. I'd like to force a rescan to potentially fix some issues with album artwork, as described by @deluan in this comment.

How can I run navidrome CLI commands? Just doing sudo navidrome scan -f yields "navidrome: command not found", and I presume the docker-compose command listed in the comment doesn't work because this isn't Docker.

Thanks in advance. 🙂

deluan commented 3 years ago

You'll need to do something like:

$ /path/to/navidrome/binary/navidrome -c /path/to/config/file/navidrome.toml scan -f

For the actual paths, @ericgaspar is more equipped to answer :)

ericgaspar commented 3 years ago

That would be it: /opt/yunohost/navidrome/navidrome -c /var/lib/navidrome/navidrome.toml scan -f

I get this error when running the command though:

 _   _             _     _
| \ | |           (_)   | |
|  \| | __ ___   ___  __| |_ __ ___  _ __ ___   ___
| . ` |/ _` \ \ / / |/ _` | '__/ _ \| '_ ` _ \ / _ \
| |\  | (_| |\ V /| | (_| | | | (_) | | | | | |  __/
\_| \_/\__,_| \_/ |_|\__,_|_|  \___/|_| |_| |_|\___|
                           Version: 0.30.1 (a2e0acd)

INFO[0000] Configuring Media Folder                      name="Music Library" path=/home/yunohost.navidrome/Music
ERRO[0000] SQL: `SELECT * FROM user WHERE is_admin = ? ORDER BY updated_at asc LIMIT 1`  args="[true]" elapsedTime="997.287µs" error="no such table: user" rowsAffected=1
WARN[0000] No admin user found!                          error="no such table: user"
ERRO[0000] Error importing MediaFolder                   error="no such table: media_file" folder=/home/yunohost.navidrome/Music
ERRO[0000] SQL: `UPDATE property SET value = ? WHERE id = ?`  args="['1597693364217','LastScan-/home/yunohost.navidrome/Music']" elapsedTime="35.968µs" error="no such table: property" rowsAffected=0
ERRO[0000] Errors while scanning media. Please check the logs
ERRO[0000] Error scanning media folder                   error="errors while scanning media" folder=/home/yunohost.navidrome/Music
INFO[0000] Finished full rescan
SpencerDub commented 3 years ago

Yup, I ran the same thing and got the same errors, @ericgaspar!

deluan commented 3 years ago

How is the DataFolder being set? You also need to pass it to the scan command, or set it in the config file.

EDIT: Or else run the command from the folder where the navidrome.db is created. I know this is confusing ATM, I'm working on making the rescan less painful

ericgaspar commented 3 years ago

Adding the DataFolder option to navidrome.toml did fix the issue. I merged the change to the testing branch. Thanks @deluan for your help!

SpencerDub commented 3 years ago

@ericgaspar If I wanted to add that to navidrome.toml on my currently running instance, would the value for DataFolder be /opt/yunohost/navidrome?

ericgaspar commented 3 years ago

The value to add to navidrome.toml should be: DataFolder = "/var/lib/navidrome"

starkgate commented 5 months ago

For anyone looking for information on this, the command to run on 0.50.2 is simply ./navidrome scan