Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mpd
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Иван Мажукин
mpd
Commits
ca9795c3
Commit
ca9795c3
authored
Aug 08, 2012
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
conf: add a "database" block
The new block overrides the "db_file" setting, and allows configuring any database plugin.
parent
dc2fa246
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
138 additions
and
6 deletions
+138
-6
user.xml
doc/user.xml
+119
-0
conf.c
src/conf.c
+1
-0
main.c
src/main.c
+18
-6
No files found.
doc/user.xml
View file @
ca9795c3
...
...
@@ -165,6 +165,53 @@ systemctl start mpd.socket</programlisting>
</section>
<section>
<title>
Configuring database plugins
</title>
<para>
If a music directory is configured, one database plugin is
used. To configure this plugin, add a
<varname>
database
</varname>
block to
<filename>
mpd.conf
</filename>
:
</para>
<programlisting>
database {
plugin "simple"
path "/var/lib/mpd/db"
}
</programlisting>
<para>
The following table lists the
<varname>
database
</varname>
options valid for all plugins:
</para>
<informaltable>
<tgroup
cols=
"2"
>
<thead>
<row>
<entry>
Name
</entry>
<entry>
Description
</entry>
</row>
</thead>
<tbody>
<row>
<entry>
<varname>
plugin
</varname>
</entry>
<entry>
The name of the plugin.
</entry>
</row>
</tbody>
</tgroup>
</informaltable>
</section>
<section>
<title>
Configuring input plugins
</title>
<para>
...
...
@@ -618,6 +665,78 @@ systemctl start mpd.socket</programlisting>
<title>
Plugin reference
</title>
<section>
<title>
Database plugins
</title>
<section>
<title><varname>
simple
</varname></title>
<para>
The default plugin. Stores a copy of the database in
memory. A file is used for permanent storage.
</para>
<informaltable>
<tgroup
cols=
"2"
>
<thead>
<row>
<entry>
Setting
</entry>
<entry>
Description
</entry>
</row>
</thead>
<tbody>
<row>
<entry>
<varname>
path
</varname>
</entry>
<entry>
The path of the database file.
</entry>
</row>
</tbody>
</tgroup>
</informaltable>
</section>
<section>
<title><varname>
proxy
</varname></title>
<para>
Provides access to the database of another MPD instance
using
<filename>
libmpdclient
</filename>
. Experimental!
</para>
<informaltable>
<tgroup
cols=
"2"
>
<thead>
<row>
<entry>
Setting
</entry>
<entry>
Description
</entry>
</row>
</thead>
<tbody>
<row>
<entry>
<varname>
host
</varname>
</entry>
<entry>
The host name of the "master" MPD instance.
</entry>
</row>
<row>
<entry>
<varname>
port
</varname>
</entry>
<entry>
The port number of the "master" MPD instance.
</entry>
</row>
</tbody>
</tgroup>
</informaltable>
</section>
</section>
<section>
<title>
Input plugins
</title>
<section>
...
...
src/conf.c
View file @
ca9795c3
...
...
@@ -102,6 +102,7 @@ static struct config_entry config_entries[] = {
{
.
name
=
CONF_DESPOTIFY_PASSWORD
,
false
,
false
},
{
.
name
=
CONF_DESPOTIFY_HIGH_BITRATE
,
false
,
false
},
{
.
name
=
"filter"
,
true
,
true
},
{
.
name
=
"database"
,
false
,
true
},
};
static
bool
...
...
src/main.c
View file @
ca9795c3
...
...
@@ -154,35 +154,47 @@ glue_mapper_init(GError **error_r)
static
bool
glue_db_init_and_load
(
void
)
{
const
struct
config_param
*
param
=
config_get_param
(
"database"
);
const
struct
config_param
*
path
=
config_get_param
(
CONF_DB_FILE
);
if
(
param
!=
NULL
&&
path
!=
NULL
)
g_message
(
"Found both 'database' and '"
CONF_DB_FILE
"' setting - ignoring the latter"
);
GError
*
error
=
NULL
;
bool
ret
;
if
(
!
mapper_has_music_directory
())
{
if
(
param
!=
NULL
)
g_message
(
"Found database setting without "
CONF_MUSIC_DIR
" - disabling database"
);
if
(
path
!=
NULL
)
g_message
(
"Found "
CONF_DB_FILE
" setting without "
CONF_MUSIC_DIR
" - disabling database"
);
return
true
;
}
if
(
path
==
NULL
)
MPD_ERROR
(
CONF_DB_FILE
" setting missing"
);
struct
config_param
*
allocated
=
NULL
;
struct
config_param
*
param
=
config_new_param
(
"database"
,
path
->
line
);
config_add_block_param
(
param
,
"path"
,
path
->
value
,
path
->
line
);
if
(
param
==
NULL
&&
path
!=
NULL
)
{
allocated
=
config_new_param
(
"database"
,
path
->
line
);
config_add_block_param
(
allocated
,
"path"
,
path
->
value
,
path
->
line
);
param
=
allocated
;
}
if
(
!
db_init
(
param
,
&
error
))
MPD_ERROR
(
"%s"
,
error
->
message
);
config_param_free
(
param
);
if
(
allocated
!=
NULL
)
config_param_free
(
allocated
);
ret
=
db_load
(
&
error
);
if
(
!
ret
)
MPD_ERROR
(
"%s"
,
error
->
message
);
/* run database update after daemonization? */
return
db_exists
();
return
!
db_is_simple
()
||
db_exists
();
}
/**
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment