Skip to content

mpdev_update.1

Manvendra Bhangui edited this page Jan 17, 2025 · 3 revisions

NAME

mpdev_update - Update stats, sticker sqlite db from mpd database

SYNOPSIS

mpdev_update [option]

DESCRIPTION

mpdev_update creates/updates stats.db or sticker.db from the mpd(1) database. It sends the listinfo command to mpd to get list of all music files. mpdev_update uses the %mtime% tag for a file from the mpd(1) database.

OPTIONS

-v
Set verbose output. You can increase verbosity by specifying it multiple times

-i IP
IP address of mpd host if different from localhost

-p port
port on which mpd(1) is listening if different from 6600

-s unix_socket
Unix domain socket in case you don't want to use IP and port

-d db_file_path
full path to the sqlite3(1) stats database

-D 0 | 1
0 to insert new records in stats.db, 1 to insert new records in sticker.db

-U
Use update mode. The default is to use insert mode.

-j
Puts the journal in volatile memory. This saves disk I/O but at the expense of database safety and integrity. If the application using SQLite crashes in the middle of a transaction when the MEMORY journaling mode is set, then the database file will very likely go corrupt.

-t
Turns on transaction mode at the beginning. This improves performance. But if the application crashes in the middle, all new changes will be lost

-S
Turns Off synchronous mode. With synchronous OFF, mpdev_update continues without syncing as soon as it has handed data off to the operating system. In case mpdev_update crashes, the data will be safe, but the database might become corrupted if the operating system crashes or the computer loses power before that data has been written to the disk. On the other hand, commits can be orders of magnitude faster with synchronous OFF.

-P
Print SQL statements used during db creation

Examples 1. create stats.db in the current directory

$ mpdev_update -S -j -t -D 0 -d stats.db
Processed 42630 rows, Failures 0 rows, Updated 42636 rows

real    0m0.830s
user    0m0.405s
sys     0m0.096s

2. Update stats.db in the current directory and add 6 new songs

$ mpdev_update -S -j -t -D 0 -d stats.db
Processed 42636 rows, Failures 0 rows, Updated 6 rows

real    0m0.725s
user    0m0.353s
sys     0m0.067s

REPORTING BUGS

If you find a bug, please report it at https://github.com/mbhangui/mpdev/issues

COPYRIGHT

Copyright (c) 2020 Manvendra Bhangui <mpdev@indimail.org>

Free use of this software is granted under the terms of the GNU General Public License (GPLv2).

AUTHOR

Manvendra Bhangui <manvendra@indimail.org>

SEE ALSO

mpd(1) sqlite3(1) mpdev_cleanup(1), mpdev(1),

Clone this wiki locally