Thank you for your donation!


Solved: Update or Re-Gen MPD Database from Command Line
#1
What is the command to update or re-gen the MPD Database from the command line?

I have an script to sync music/podcast files and need to update the database once new files are added/removed.

Solved: mpc update
Several piZeroW with HiFiBerry Amp2 and Allo Mini Boss DAC
Reply
#2
I'm also curious if there is a command that will reset the connected wifi and revert to hotspot mode.
Several piZeroW with HiFiBerry Amp2 and Allo Mini Boss DAC
Reply
#3
(12-15-2019, 02:44 PM)normand Wrote: What is the command to update or re-gen the MPD Database from the command line?

I have an script to sync music/podcast files and need to update the database once new files are added/removed.


Try the mpc command; it's chock-full of goodness. Here's a snippet of its help output. Note 'mpc update' and 'mpc rescan'.

Code:
pi@moodeLR:~ $ mpc help
Usage: mpc [options] <command> [<arguments>]
mpc version: 0.31

Options:
 -v, --verbose                   Give verbose output
 -q, --quiet                     Suppress status message
 -q, --no-status                 synonym for --quiet
 -h, --host=<host>               Connect to server on <host>
 -P, --password=<password>       Connect to server using password <password>
 -p, --port=<port>               Connect to server port <port>
 -f, --format=<format>           Print status with format <format>
 -w, --wait                      Wait for operation to finish (e.g. database update)
 -r, --range=[<start>]:[<end>]   Operate on a range (e.g. when loading a playlist)

Commands:
 mpc                                                   Display status
...
 mpc update [<path>]                                   Scan music directory for updates
 mpc rescan [<path>]                                   Rescan music directory (including unchanged files)
...

See man 1 mpc for more information about mpc commands and options



Regards,
Kent
Reply
#4
(12-15-2019, 02:48 PM)normand Wrote: I'm also curious if there is a command that will reset the connected wifi and revert to hotspot mode.

Try

Code:
sqlite3 /var/local/www/db/moode-sqlite3.db "update cfg_network set wlanssid='None (activates AP mode)' where iface='wlan0'"

sudo reboot
Reply
#5
On a slightly related topic, is it possible within the moode GUI to send a “broadcast” Update/Regen to multiple RPi on the LAN? Or do they have to be updated individually? (Similarly, for “update/regen covers”).
Reply
#6
(12-15-2019, 05:55 PM)suzywong Wrote: On a slightly related topic, is it possible within the moode GUI to send a “broadcast” Update/Regen to multiple RPi on the LAN? Or do they have to be updated individually?  (Similarly, for “update/regen covers”).


Interesting thought. 

Certainly, technically it's feasible. A moOde player can detect other moOde players on the same LAN (see the code behind m>players) and mpc can take a -h <host> option. 

Is this a high-priority use case though? It would need more front-end and back-end code to be written. As Tim remarked elsewhere, "[O]ur project needs additional developers to code and test all these nice ideas otherwise they will just gather dust because the TODO list is already way under funded."

Don't know what is meant by "update/regen covers”.

Regards,
Kent
Reply
#7
I'm trying to push commands to multiple devices on different networks via MQTT. I'm not good with python. Got it to work via node red, but on a pi zero it just takes a huge performance hit.
Reply
#8
(12-15-2019, 07:47 PM)TheOldPresbyope Wrote:
(12-15-2019, 05:55 PM)suzywong Wrote: On a slightly related topic, is it possible within the moode GUI to send a “broadcast” Update/Regen to multiple RPi on the LAN? Or do they have to be updated individually?  (Similarly, for “update/regen covers”).


Interesting thought. 

Certainly, technically it's feasible. A moOde player can detect other moOde players on the same LAN (see the code behind m>players) and mpc can take a -h <host> option. 

Is this a high-priority use case though? It would need more front-end and back-end code to be written. As Tim remarked elsewhere, "[O]ur project needs additional developers to code and test all these nice ideas otherwise they will just gather dust because the TODO list is already way under funded."

Don't know what is meant by "update/regen covers”.

Regards,
Kent
Point 1. 
High priority? Nope. 
Nice to have? Yes, why not. Add to the todo list?

Point 2.
Configure/Library/Update Album Cover Thumbnail cache

I have occasionally found that having added a new CD to the database, the thumbnail does not show up on the (what I call) “iTunes songs screen”. So I have got into the habit of following a database update (to add a new CD) with an update to the thumbnails cache. Probably something related to my system configuration but, hey, it works for me!

Maybe another option would be to force a thumbnail cache update automatically following a database update?

But none of this is critical Smile
Reply


Forum Jump: