1 Configure Server

These settings define the server configuration, this includes UPnP behavior, selection of database, accounts for the UI as well as installation locations of shared data.

1.1 Server

server
Type: Section
Required: True
<server> ... </server>

This section defines the server configuration parameters.

1.1.1 Server Attributes

debug-mode
Type: enum
Required: False
Default: unset

Added in version 2.0.0.

Changed in version 2.6.1: new option inotify

Changed in version 3.0.0: new option thumbnailer

Changed in version 3.0.0: new option postgres

Activate debugging messages only for certain subsystems. The following subsystems are available: thread, sqlite3, cds, server, config, content, update, mysql, sql, proc, autoscan, script, web, layout, exif, exiv2, transcoding, taglib, ffmpeg, wavpack, requests, device, connmgr, mrregistrar, xml, clients, iohandler, online, metadata, matroska, curl, util, inotify, thumbnailer, postgres and verbose. Multiple subsystems can be combined with a |. Names are not case sensitive. verbose turns on even more messages for the subsystem. This is for developers and testers mostly and has to be activted in cmake options at compile time (-DWITH_DEBUG_OPTIONS=YES).

  • Example: debug-mode="Cds|Content|Web" for messages when accessing the server via upnp or web.

upnp-max-jobs
Type: Integer
Required: False
Default: 500

Added in version 2.4.0.

Set maximum number of jobs in libpupnp internal threadpool. Allows pending requests to be handled.

1.1.2 Server Items

1.1.2.1 Port

port
Type: Integer
Required: False
Default: 0 (automatic)
<port>0</port>

Specifies the port where the server will be listening for HTTP requests. Note, that because of the implementation in the UPnP SDK only ports above 49152 are supported. The value of zero means, that a port will be automatically selected by the SDK.

1.1.2.2 IP Address

ip
Type: String
Required: False
Default: ip of the first available network interface
<ip>192.168.0.23</ip>

Specifies the IP address to bind to, by default one of the available interfaces will be selected.

1.1.2.3 Network interface

interface
Type: String
Required: False
Default: first available network interface
<interface>eth0</interface>

Specifies the interface to bind to, by default one of the available interfaces will be selected.

1.1.2.4 Name

server name
Type: String
Required: True
Default: Gerbera
<name>Gerbera</name>

Server’s friendly name, you will see this on your devices that you use to access the server.

1.1.2.5 Manufacturer

manufacturer
Type: String
Required: False
Default: empty
<manufacturer>Gerbera Developers</manufacturer>

This tag sets the manufacturer name of a UPnP device.

1.1.2.6 Manufacturer Url

manufacturerURL
Type: String
Required: False
Default: https://gerbera.io/
<manufacturerURL>https://gerbera.io/</manufacturerURL>

This tag sets the manufacturer URL of a UPnP device, a custom setting may be necessary to trick some renderers in order to enable special features that otherwise are only active with the vendor implemented server.

1.1.2.7 Virtual Url

virtualURL
Type: String
Required: False
Default: unset
<virtualURL>https://gerbera.io/</virtualURL>

This tag sets the virtual URL of Gerbera content which is part of the browse response. The value defaults to http://<ip>:<port>.

1.1.2.8 External Url

externalURL
Type: String
Required: False
Default: unset

Added in version 2.0.0.

<externalURL>https://gerbera.io/</externalURL>

This tag sets the external URL of Gerbera web UI, a custom setting may be necessary if you want to access the web page via a reverse proxy. The value defaults to virtualURL or http://<ip>:<port> if virtualURL is not set.

1.1.2.9 Model Name

modelName
Type: String
Required: False
Default: Gerbera
<modelName>Gerbera</modelName>

This tag sets the model name of a UPnP device, a custom setting may be necessary to trick some renderers in order to enable special features that otherwise are only active with the vendor implemented server.

1.1.2.10 Model Number

modelNumber
Type: String
Required: False
Default: Gerbera version
<modelNumber>42.7.0</modelNumber>

This tag sets the model number of a UPnP device, a custom setting may be necessary to trick some renderers in order to enable special features that otherwise are only active with the vendor implemented server.

1.1.2.11 Model Url

modelURL
Type: String
Required: False
Default: empty
<modelURL>http://example.org/product-23</modelURL>

This tag sets the model URL (homepage) of a UPnP device.

1.1.2.12 Serial Number

serialNumber
Type: String
Required: False
Default: 1
<serialNumber>42</serialNumber>

This tag sets the serial number of a UPnP device.

1.1.2.13 Presentation Url

presentationURL
Type: String
Required: False
Default: /
<presentationURL append-to="ip">80/index.html</presentationURL>

The presentation URL defines the location of the servers user interface, usually you do not need to change this however, vendors who want to ship our server along with their NAS devices may want to point to the main configuration page of the device.

Attributes

append-to
Type: enum
Required: False
Default: none
append-to="ip"

The append-to attribute defines how the text in the presentationURL tag should be treated. The allowed values are:

Value

Meaning

none

Use the string exactly as it appears in the presentationURL tag.

ip

Append the string specified in the presentationURL tag to the ip address of the server,
this is useful in a dynamic ip environment where you do not know the ip
but want to point the URL to the port of your web server.

port

Append the string specified in the presentationURL tag to the serverip and port,
this may be useful if you want to serve some static pages using the built in web server.

1.1.2.14 UDN

udn
Type: String
Required: True
Default: none
<udn>uuid:[generated-uuid]</udn>

Unique Device Name, according to the UPnP spec it must be consistent throughout reboots. You can fill in something yourself. Review the Generating Configuration section of the documentation to see how to use gerbera to create a default configuration file.

1.1.2.15 Home Directory

home
Type: Path
Required: True
Default: ~ - the HOME directory of the user running gerbera.
<home override="yes">/home/your_user_name/gerbera</home>

Server home - the server will search for the data that it needs relative to this directory - basically for the sqlite database file. The gerbera.html bookmark file will also be generated in that directory. The home directory is only relevant if the config file or the config dir was specified in the command line. Otherwise it defaults to the HOME path of the user runnung Gerbera. The environment variable GERBERA_HOME can be used to point to another directory, in which case the config file is expected as ${GERBERA_HOME}/.config/gerbera.

Attributes:

override
Type: Boolean
Required: False
Default: no
override="yes"

Force all relative paths to base on the home directory of the config file even if it was read relative to the environment variables or from command line. This means that Gerbara changes its home during startup.

1.1.2.16 Temporary Directory

tmpdir
Type: Path
Required: True
Default: /tmp/
<tmpdir>/tmp/</tmpdir>

Selects the temporary directory that will be used by the server.

1.1.2.17 Web Directory

webroot
Type: Path
Required: True
Default: depends on the installation prefix that is passed to the configure script.
<webroot>/usr/share/gerbera/web</webroot>

Root directory for the web server, this is the location where device description documents, UI html and js files, icons, etc. are stored.

1.1.2.18 Alive Interval

alive
Type: Integer
Required: False
Default: 180, (Results in alive messages every 60s, see below) this is according to the UPnP specification.
<alive>180</alive>
  • Min: 62 (A message sent every 1s, see below)

Interval for broadcasting SSDP:alive messages

An advertisement will be sent by LibUPnP every (this value/2)-30 seconds, and will have a cache-control max-age of this value.

Example:

A value of 62 will result in an SSDP advertisement being sent every second. (62 / 2 = 31) - 30 = 1. The default value of 180 results results in alive messages every 60s. (180 / 2 = 90) - 30 = 60.

Note:

If you experience disconnection problems from your device, e.g. Playstation 4, when streaming videos after about 5 minutes, you can try changing the alive value to 86400 (which is 24 hours).

1.1.2.19 PC Directory

pc-directory
Type: Section
Required: False
<pc-directory upnp-hide="yes" web-hide="yes"/>

Tweak visibility of PC directory, i.e. root entry for physical structure.

1.1.2.19.1 Attributes
upnp-hide
Type: Boolean
Required: False
Default: no
upnp-hide="yes"

Enabling this option will make the PC-Directory container invisible for UPnP devices.

web-hide
Type: Boolean
Required: False
Default: no

Added in version 2.6.0.

web-hide="yes"

Enabling this option will make the PC-Directory container invisible in the web UI.

1.1.2.20 Bookmark File

bookmark
Type: String
Required: False
Default: gerbera.html
<bookmark>gerbera.html</bookmark>

The bookmark file offers an easy way to access the user interface, it is especially helpful when the server is not configured to run on a fixed port. Each time the server is started, the bookmark file will be filled in with a redirect to the servers current IP address and port. To use it, simply bookmark this file in your browser, the default location is ~/.config/gerbera/gerbera.html

1.1.2.21 UPnP String Limit

upnp-string-limit
Type: Integer
Required: False
Default: -1 (disabled)
<upnp-string-limit>100</upnp-string-limit>

This will limit title and description length of containers and items in UPnP browse replies, this feature was added as a workaround for the TG100 bug which can only handle titles no longer than 100 characters. A negative value will disable this feature, the minimum allowed value is “4” because three dots will be appended to the string if it has been cut off to indicate that limiting took place.

1.1.2.22 Logging

logging
Type: Section
Required: False

Added in version 2.2.0.

<logging rotate-file-size="1000000" rotate-file-count="3"/>

This section defines various logging settings.

1.1.2.22.1 Attributes
rotate-file-size
Type: Integer
Required: False
Default: 5242880 (5 MB)
rotate-file-size="1024000"

When using command line option --rotatelog this value defines the maximum size of the log file before rotating.

rotate-file-count
Type: Integer
Required: False
Default: 10
rotate-file-count="5"

When using command line option --rotatelog this value defines the number of files in the log rotation.

1.2 Web Interface

ui
Type: Section
Required: False
<ui enabled="yes" poll-interval="2" poll-when-idle="no"/>

This section defines various user interface settings.

WARNING!

The server has an integrated filesystem browser, that means that anyone who has access to the UI can browse your filesystem (with user permissions under which the server is running) and also download your data! If you want maximum security - disable the UI completely! Account authentication offers simple protection that might hold back your kids, but it is not secure enough for use in an untrusted environment!

Note:

since the server is meant to be used in a home LAN environment the UI is enabled by default and accounts are deactivated, thus allowing anyone on your network to connect to the user interface.

1.2.1 Web Interface Attributes

ui enabled
Type: Boolean
Required: False
Default: yes
enabled="no"

Enables (yes) or disables (no) the web user interface.

show-tooltips
Type: Boolean
Required: False
Default: yes
show-tooltips="no"

This setting specifies if icon tooltips should be shown in the web UI.

show-numbering
Type: Boolean
Required: False
Default: yes
show-numbering="no"

Set track number to be shown in the web UI.

show-thumbnail
Type: Boolean
Required: False
Default: yes
show-thumbnail="no"

This setting specifies if thumbnails or cover art should be shown in the web UI.

enable-video
Type: Boolean
Required: False
Default: no
enable-video="no"

Enable video preview in web ui.

poll-interval
Type: Integer
Required: False
Default: 2
poll-interval="10"

The poll-interval is an integer value which specifies how often the UI will poll for tasks. The interval is specified in seconds, only values greater than zero are allowed. The value can be given in a valid time format.

fs-add-item
Type: Boolean
Required: False
Default: no

Added in version 2.5.0.

fs-add-item="yes"

Show the (deprecated) option to add items without autoscan functionality.

edit-sortkey
Type: Boolean
Required: False
Default: no

Added in version 2.6.0.

edit-sortkey="yes"

Show the edit field sortKey for objects.

poll-when-idle
Type: Boolean
Required: False
Default: no
poll-when-idle="yes"

The poll-when-idle attribute influences the behavior of displaying current tasks: - when the user does something in the UI (i.e. clicks around) we always poll for the current task and will display it - if a task is active, we will continue polling in the background and update the current task view accordingly - when there is no active task (i.e. the server is currently idle) we will stop the background polling and only request updates upon user actions, but not when the user is idle (i.e. does not click around in the UI)

Setting poll-when-idle to “yes” will do background polling even when there are no current tasks; this may be useful if you defined multiple users and want to see the tasks the other user is queuing on the server while you are actually idle.

The tasks that are monitored are:

  • adding files or directories

  • removing items or containers

  • automatic rescans

1.2.2 Source Documentation Url

Type: String
Required: False
Default: empty

Added in version 2.4.0.

<source-docs-link>./dev/index.html</source-docs-link>

Add link to some source documentation which can be generated by make doc. If it is empty the link in the web UI will be hidden.

1.2.3 User Documentation Url

Type: String
Required: False
Default: for release builts: “https://docs.gerbera.io/en/stable/”, for test builts: “https://docs.gerbera.io/en/latest/

Added in version 2.4.0.

<user-docs-link>./doc/index.html</user-docs-link>

Add link to the user documentation if you want it locally hosted or make sure the version is matching you installation.

1.2.4 Content Security Policy

content-security-policy
Type: String
Required: False
Default: default-src %HOSTS% 'unsafe-eval' 'unsafe-inline'; img-src *; media-src *; child-src 'none';

Added in version 2.4.0.

<content-security-policy>default-src %HOSTS% 'unsafe-eval' 'unsafe-inline'; img-src *; media-src *; child-src 'none';</content-security-policy>

Define the “Content-Security-Policy” string for the web ui. The string %HOHSTS% will be replaced by the IP address and known server names. Newlines will automatically be replaced by ;.

Example:

Content security policy to host source documentation

<content-security-policy>
    font-src %HOSTS% https://fonts.gstatic.com/
    style-src %HOSTS% https://fonts.googleapis.com 'unsafe-inline'
    img-src *
    media-src *
    child-src 'none'
    default-src %HOSTS% 'unsafe-eval' 'unsafe-inline'
</content-security-policy>

1.2.5 Extension Mimetype Mapping

ui extension-mimetype
Type: Section
Required: False
Default: Extensible default see above, see extend
<extension-mimetype default="application/octet-stream">
    <map from="html" to="text/html"/>
    <map from="js" to="application/javascript"/>
    <map from="json" to="application/json"/>
    <map from="css" to="text/css"/>
</extension-mimetype>

For description see Import Extension Mimetype Mapping.

Attributes

ui extension-mimetype default
Type: String
Required: False
Default: application/octet-stream
default="application/octet-stream"

1.2.6 Accounts

accounts
Type: Section
Required: False
<accounts enabled="yes" session-timeout="30">
  <account user="admin" password="password"/>
  <account user="reader" password="secret"/>
</account>

This section holds various account settings.

1.2.6.1 Attributes

accounts enabled
Type: Boolean
Required: False
Default: yes
enabled="no"

Specifies if accounts are enabled yes or disabled no.

session-timeout
Type: Integer
Required: False
Default: 30
session-timeout="120"

The session-timeout attribute specifies the timeout interval in minutes. The server checks every five minutes for sessions that have timed out, therefore in the worst case the session times out after session-timeout + 5 minutes. The value can be given in a valid time format.

1.2.6.2 Account Settings

There can be multiple users, however this is mainly a feature for the future. Right now there are no per-user permissions.

account
Type: Section
Required: False
<account user="admin" password="secret"/>
account user
Type: String
Required: False
Default: empty
user="admin"
account password
Type: String
Required: False
Default: empty
password="secret"

1.2.7 Items Per Page

items-per-page
Type: Section
Required: False
<items-per-page default="25">

1.2.7.1 Attributes

items-per-page default
Type: Integer
Required: False
Default: 25
default="50"

This sets the default number of items per page that will be shown when browsing the database in the web UI. The values for the items per page drop down menu can be defined in the following manner:

1.2.7.2 Items

items-per-page option
Type: Integer
Required: False
Default: Extensible Default: 10, 25, 50, 100, see extend
<option>10</option>
<option>25</option>
<option>50</option>
<option>100</option>
Note:

this list must contain the default value, i.e. if you define a default value of 25, then one of the <option> tags must also list this value.

1.3 Storage

storage
Type: Section
Required: True
<storage use-transactions="yes">

Defines the storage section - database selection is done here. Currently SQLite3, MySQL and PostgreSQL are supported. Each storage driver has it’s own configuration parameters.

Exactly one driver must be enabled: sqlite3, mysql or postgres. The available options depend on the selected driver.

1.3.1 Storage Attributes

use-transactions
Type: Boolean
Required: False
Default: no
use-transactions="yes"

Enables transactions. This feature should improve the overall import speed and avoid race-conditions on import. The feature caused some issues and set to no. If you want to support testing, turn it to yes and report if you can reproduce the issue.

enable-sort-key
Type: Boolean
Required: False
Default: yes

Added in version 2.6.0.

enable-sort-key="no"

Switches default sorting by property of dc_title to sort_key. The sort key is derived from the filename by expanding all numbers to fixed digits.

string-limit
Type: Integer
Required: False
Default: 255

Added in version 2.6.0.

string-limit="250"

Set the maximum length of indexed string columns like dc_title. Changing this value after initializing the database will produce a warning in gerbera log and may cause database errors because the string is not correctly truncated.

1.3.2 SQLite

sqlite3
Type: Section
Required: False
<sqlite3 enabled="yes">

Defines the SQLite storage driver section.

1.3.2.1 SQLite Attributes

sqlite3 enabled
Type: Boolean
Required: False
Default: yes
enabled="no"

Enables SQLite database storage. If SQLite is enabled MySQL must be disabled.

shutdown-attempts
Type: Integer
Required: False
Default: 5

Added in version 2.5.0.

shutdown-attempts="10"

Number of attempts to shutdown the sqlite driver before forcing the application down.

1.3.2.2 Init SQL File

Below are the sqlite driver options:

sqlite3 init-sql-file
Type: Path
Required: False
Default: ${datadir}/sqlite3.sql
<init-sql-file>/etc/gerbera/sqlite3.sql</init-sql-file>

The full path to the init script for the database.

1.3.2.3 Drop SQL File

sqlite3 drop-file
Type: Path
Required: False
Default: ${datadir}/sqlite3-drop.sql

Added in version 3.0.0.

<drop-file>/etc/gerbera/sqlite3-drop.sql</drop-file>

The full path to the drop script for the database.

1.3.2.4 Upgrade Statement File

sqlite3 upgrade-file
Type: Path
Required: False
Default: ${datadir}/sqlite3-upgrade.xml
<upgrade-file>/etc/gerbera/sqlite3-upgrade.xml</upgrade-file>

1.3.2.5 Database File

The full path to the upgrade settings for the database

database-file
Type: String
Required: False
Default: gerbera.db
<database-file>gerbera.db</database-file>

The database location is relative to the server’s home, if the sqlite database does not exist it will be created automatically.

1.3.2.6 Sync Setting

synchronous
Type: Enum
Required: False
Default: off
<synchronous>off</synchronous>

Possible values are off, normal, full and extra.

This option sets the SQLite pragma synchronous. This setting will affect the performance of the database write operations. For more information about this option see the SQLite documentation: https://www.sqlite.org/pragma.html#pragma_synchronous

1.3.2.7 Journal Mode

journal-mode
Type: Enum
Required: False
Default: WAL
<journal-mode>off</journal-mode>

Possible values are OFF, DELETE, TRUNCATE, PERSIST, MEMORY and WAL

This option sets the SQLite pragma journal_mode. This setting will affect the performance of the database write operations. For more information about this option see the SQLite documentation: https://www.sqlite.org/pragma.html#pragma_journal_mode

1.3.2.8 Error Behaviour

on-error
Type: Enum (restore|fail)
Required: False
Default: restore
<on-error>restore</on-error>

This option tells Gerbera what to do if an SQLite error occurs (no database or a corrupt database). If it is set to restore it will try to restore the database from a backup file (if one exists) or try to recreate a new database from scratch.

If the option is set to fail, Gerbera will abort on an SQLite error.

1.3.2.9 SQLite Auto-Backup

backup
Type: Section
Required: False
<backup enabled="no" interval="15:00"/>

Create a database backup file for easy recovery if the main file cannot be read. The backup file can also be used to analyse the database contents while the main database is in use. This does not avoid loss of data like a regular backup.

Attributes:

backup enabled
Type: Boolean
Required: False
Default: yes
enabled="no"

Enables or disables database backup.

backup interval
Type: Integer
Required: False
Default: 600
interval="300"

Defines the backup interval in seconds. The value can be given in a valid time format.

1.3.3 MySQL and MariaDB

mysql
Type: Section
Required: False
<mysql enabled="no"/>

Defines the MySQL storage driver section.

1.3.3.1 MySQL Attributes

mysql enabled
Type: Boolean
Required: False
Default: no
enabled="yes"

Enables MySQL database storage. If MySQL is enabled SQLite must be disabled.

1.3.3.2 Server Host

mysql host
Type: String
Required: False
Default: localhost
<host>localhost</host>

This specifies the host where your MySQL database is running.

1.3.3.3 Server Port

mysql port
Type: Integer
Required: False
Default: 0
<port>0</port>

This specifies the port where your MySQL database is running.

1.3.3.4 Server User

mysql username
Type: String
Required: False
Default: gerbera
<username>root</username>

This option sets the user name that will be used to connect to the database.

1.3.3.5 Server Password

mysql password
Type: String
Required: False
Default: no password
<password>5eryS€cre!</password>

Defines the password for the MySQL user. If the tag doesn’t exist Gerbera will use no password, if the tag exists, but is empty Gerbera will use an empty password. MySQL has a distinction between no password and an empty password.

1.3.3.6 Database Name

mysql database
Type: String
Required: False
Default: gerbera
<database>gerbera</database>

Name of the database that will be used by Gerbera.

1.3.3.7 Init SQL File

mysql init-sql-file
Type: Path
Required: False
Default: ${datadir}/mysql.sql
<init-sql-file>/etc/gerbera/mysql.sql</init-sql-file>

The full path to the init script for the database.

1.3.3.8 Drop SQL File

mysql drop-file
Type: Path
Required: False
Default: ${datadir}/mysql-drop.sql

Added in version 3.0.0.

<drop-file>/etc/gerbera/mysql-drop.sql</drop-file>

The full path to the drop script for the database.

1.3.3.9 Upgrade Statement File

mysql upgrade-file
Type: Path
Required: False
Default: ${datadir}/mysql-upgrade.xml
<upgrade-file>/etc/gerbera/mysql-upgrade.xml</upgrade-file>

The full path to the upgrade settings for the database

1.3.3.10 Database Engine

mysql engine
Type: String
Required: False
Default: MyISAM

Added in version 2.6.0.

<engine>Aria</engine>

Select the storage engine for the tables. Only effective if database has to be created on first start. The storage engines for MariaDB can be found here https://mariadb.com/kb/en/choosing-the-right-storage-engine/ but may depend on your actual version.

1.3.3.11 Charset

mysql charset
Type: String
Required: False
Default: utf8

Added in version 2.6.0.

<charset>utf8mb4</charset>

Select the character set for the tables. Only effective if database has to be created on first start. The character sets for MariaDB can be found here https://mariadb.com/kb/en/supported-character-sets-and-collations/ but may depend on your actual version.

1.3.3.12 Collation

mysql collation
Type: String
Required: False
Default: utf8_general_ci

Added in version 2.6.0.

<collation>utf8mb4_unicode_ci</collation>

Select the collation for the string columns. Only effective if database has to be created on first start. The collations for MariaDB can be found here https://mariadb.com/kb/en/supported-character-sets-and-collations/#collations but may depend on your actual version.

1.3.4 Postgres

postgres
Type: Section
Required: False

Added in version 3.0.0.

<postgres enabled="no"/>

Defines the PostgreSQL storage driver section.

1.3.4.1 Postgres Attributes

postgres enabled
Type: Boolean
Required: False
Default: no
enabled="yes"

Enables PostgreSQL database storage. If PostgreSQL is enabled SQLite must be disabled.

1.3.4.2 Server Host

postgres host
Type: String
Required: False
Default: localhost
<host>localhost</host>

This specifies the host where your PostgreSQL database is running.

1.3.4.3 Server Port

postgres port
Type: Integer
Required: False
Default: 0
<port>0</port>

This specifies the port where your PostgreSQL database is running.

1.3.4.4 Server User

postgres username
Type: String
Required: False
Default: gerbera
<username>root</username>

This option sets the user name that will be used to connect to the database.

1.3.4.5 Server Password

postgres password
Type: String
Required: False
Default: no password
<password>5eryS€cre!</password>

Defines the password for the PostgreSQL user. If the tag doesn’t exist or is empty Gerbera will use no password.

1.3.4.6 Database Name

postgres database
Type: String
Required: False
Default: gerbera
<database>gerbera</database>

Name of the database that will be used by Gerbera.

1.3.4.7 Init SQL File

postgres init-sql-file
Type: Path
Required: False
Default: ${datadir}/postgres.sql
<init-sql-file>/etc/gerbera/postgres.sql</init-sql-file>

The full path to the init script for the database.

1.3.4.8 Drop SQL File

postgres drop-file
Type: Path
Required: False
Default: ${datadir}/postgres-drop.sql
<drop-file>/etc/gerbera/postgres-drop.sql</drop-file>

The full path to the drop script for the database.

1.3.4.9 Upgrade Statement File

postgres upgrade-file
Type: Path
Required: False
Default: ${datadir}/postgres-upgrade.xml
<upgrade-file>/etc/gerbera/postgres-upgrade.xml</upgrade-file>

The full path to the upgrade settings for the database

1.4 UPnP Protocol

upnp
Type: Section
Required: False
<upnp multi-value="yes" search-result-separator=" : ">

Modify the settings for UPnP items.

This section defines the properties which are sent to UPnP clients as part of the response.

1.4.1 UPnP Attributes

searchable-container-flag
Type: Boolean
Required: False
Default: no
searchable-container-flag="yes"

Only return containers that have the flag searchable set.

dynamic-descriptions
Type: Boolean
Required: False
Default: yes

Added in version 2.2.0.

dynamic-descriptions="no"

Return UPnP description requests based on the client type. This hides, e.g., Samsung specific extensions in description.xml and cds.xml from clients that don’t handle the respective requests.

literal-host-redirection
Type: Boolean
Required: False
Default: no

Added in version 2.0.0.

literal-host-redirection="yes"

Enable literal IP redirection.

search-result-separator
Type: String
Required: False
Default: " - "
search-result-separator=" : "

String used to concatenate result segments as defined in search-item-result

multi-value
Type: Boolean
Required: False
Default: yes
multi-value="no"

Enables sending multi-valued metadata in separate items. If set to no all values are concatenated by multi-value-separator. Otherwise each item is added separately.

Example:

The follow data is sent if set to no

<upnp:artist>First Artist / Second Artist</upnp:artist>

The follow data is sent if set to yes

<upnp:artist>First Artist</upnp:artist>
<upnp:artist>Second Artist</upnp:artist>
search-filename
Type: Boolean
Required: False
Default: no
search-filename="yes"

Older versions of gerbera have been searching in the file name instead of the title metadata. If set to yes this behaviour is back, even if the result of the search shows another title.

caption-info-count
Type: Integer
Required: False
Default: -1
caption-info-count="0"

Number of sec::CaptionInfoEx entries to write to UPnP result. Default can be overwritten by clients setting. -1 means unlimited.

1.4.2 Search Item Result

<search-item-result>
    <add-data tag="M_ARTIST"/>
    <add-data tag="M_TITLE"/>
</search-item-result>
search-item-result
Type: Section
Required: False
Default: Extensible Default, see extend

Set the meta-data search tags to use in search result for title. The default settings as shown above produces artist - title in the result list.

search-item-result add-data
Type: Section
Required: False

Add tag to result string.

search-item-result add-data tag
Type: String
Required: True

The list of valid tags can be found under tags

1.4.3 Response Properties

<album-properties>...</album-properties>
<artist-properties>...</artist-properties>
<genre-properties>...</genre-properties>
<playlist-properties>...</playlist-properties>
<title-properties>...</title-properties>

Defines the properties to send in the response.

album-properties
Type: Section
Required: False
Default: Extensible Default, see extend

Added in version 2.4.0.

upnp-tag

meta-data

dc:creator

M_ALBUMARTIST

dc:date

M_UPNP_DATE

dc:publisher

M_PUBLISHER

upnp:artist

M_ALBUMARTIST

upnp:albumArtist

M_ALBUMARTIST

upnp:composer

M_COMPOSER

upnp:conductor

M_CONDUCTOR

upnp:date

M_UPNP_DATE

upnp:genre

M_GENRE

upnp:orchestra

M_ORCHESTRA

upnp:producer

M_PRODUCER

artist-properties
Type: Section
Required: False
Default: Extensible Default, see extend

Added in version 2.4.0.

upnp-tag

meta-data

upnp:artist

M_ALBUMARTIST

upnp:albumArtist

M_ALBUMARTIST

upnp:genre

M_GENRE

genre-properties
Type: Section
Required: False
Default: Extensible Default, see extend

Added in version 2.4.0.

upnp-tag

meta-data

upnp:genre

M_GENRE

playlist-properties
Type: Section
Required: False
Default: Extensible Default, see extend

Added in version 2.4.0.

upnp-tag

meta-data

dc:date

M_UPNP_DATE

title-properties
Type: Section
Required: False
Default: Fixed Defaults

Added in version 2.4.0.

The title properties are automatically added and cannot be changed, but you may add them under another tag.

upnp-tag

meta-data

dc:date

M_DATE

dc:description

M_DESCRIPTION

dc:publisher

M_PUBLISHER

dc:title

M_TITLE

upnp:actor

M_ACTOR

upnp:album

M_ALBUM

upnp:albumArtURI

M_ALBUMARTURI

upnp:artist

M_ARTIST

upnp:artist@role[AlbumArtist]

M_ALBUMARTIST

upnp:author

M_AUTHOR

upnp:composer

M_COMPOSER

upnp:conductor

M_CONDUCTOR

upnp:date

M_UPNP_DATE

upnp:director

M_DIRECTOR

upnp:episodeSeason

M_PARTNUMBER

upnp:genre

M_GENRE

upnp:longDescription

M_LONGDESCRIPTION

upnp:orchestra

M_ORCHESTRA

upnp:originalTrackNumber

M_TRACKNUMBER

upnp:producer

M_PRODUCER

upnp:rating

M_RATING

upnp:region

M_REGION

upnp:playbackCount

upnp:playbackCount

upnp:lastPlaybackTime

upnp:lastPlaybackTime

upnp:lastPlaybackPosition

upnp:lastPlaybackPosition

Response properties contain the following entries.

<upnp-namespace xml-ns="gerbera" uri="https://gerbera.io"/>
<upnp-property upnp-tag="gerbera:artist" meta-data="M_ARTIST"/>

Defines an UPnP property and references the namespace for the property.

The attributes specify the property:

1.4.3.1 Property Namespace

upnp-namespace
Type: Section
Required: False

Add namespace required for properties.

xml-ns
Type: String
Required: True
xml-ns="..."

Changed in version 3.2.0: renamed from xmlns

Key for the namespace

uri
Type: String
Required: True
uri="..."

Uri for the namespace

1.4.3.2 Property Content

upnp-property
Type: Section
Required: False

Define value of an additional property

upnp-tag
Type: String
Required: True
upnp-tag="..."

UPnP tag to be send. See the UPnP specification for valid entries.

meta-data
Type: String
Required: True
meta-data="..."

Name of the metadata tag to export in upnp response. The following values are supported: M_TITLE, M_ARTIST, M_ALBUM, M_DATE, M_UPNP_DATE, M_GENRE, M_DESCRIPTION, M_LONGDESCRIPTION, M_PARTNUMBER, M_TRACKNUMBER, M_ALBUMARTURI, M_REGION, M_CREATOR, M_AUTHOR, M_DIRECTOR, M_PUBLISHER, M_RATING, M_ACTOR, M_PRODUCER, M_ALBUMARTIST, M_COMPOSER, M_CONDUCTOR, M_ORCHESTRA.

Instead of metadata, you may also use auxdata entries as defined in library-options.

1.4.4 Property Defaults

resource-defaults
Type: Section
Required: False
Default: Extensible Default, see extend

Added in version 2.4.0.

object-defaults
Type: Section
Required: False
Default: Extensible Default, see extend

Added in version 2.4.0.

container-defaults
Type: Section
Required: False
Default: Extensible Default, see extend

Added in version 2.4.0.

<resource-defaults>...</resource-defaults>
<object-defaults>...</object-properties>
<container-defaults>...</container-defaults>

Defines the default values of upnp properties if these properties are required by the UPnP request filter. If there is no defined default value, the required filter is not exported.

It contains the following entries.

property-default
Type: Section
Required: False
<property-default tag="duration" value="0"/>

Defines an UPnP property and the default value of the property.

The attributes specify the property:

property-default tag
Type: String
Required: True
tag="..."

UPnP property to define the default. Tags starting with a @ will be generated as an attribute.

property-default value
Type: String
Required: True
value="..."

Default value for the property.

1.5 Dynamic Containers

containers
Type: Section
Required: False
Default: Extensible Default, see extend
<containers enabled="yes">

Add dynamic containers to virtual layout.

This section sets the rules for additional containers which have calculated content.

Attributes:

containers enabled
Type: Boolean
Required: True
Default: yes
enabled="no"

Enables or disables the dynamic containers driver.

1.5.1 Dynamic Containers Content

containers container
Type: Section
Required: False
<container location="/New" title="Recently added" sort="-last_updated" max-count="500">
    <filter>upnp:class derivedfrom "object.item" and last_updated &gt; "@last7"</filter>
</container>
<container location="/NeverPlayed" title="Music Never Played" sort="upnp:album" upnp-shortcut="MUSIC_NEVER_PLAYED" max-count="100">
    <filter>upnp:class derivedfrom "object.item.audioItem" and (upnp:playbackCount exists false or upnp:playbackCount = "0")</filter>
</container>

Defines the properties of the dynamic container.

1.5.1.1 Containers Attributes

The following attributes can be set for containers

containers container location
Type: String
Required: True
location="..."

Position in the virtual layout where the node is added. If it is in a sub-container, e.g. /Audio/New, it only becomes visible if the import generates the parent container.

containers container title
Type: String
Required: False
Default: empty
title="..."

Text to display as title of the container. If it is empty the last section of the location is used.

containers container sort
Type: String
Required: False
Default: empty
sort="..."

UPnP sort statement to use as sorting criteria for the container.

containers container upnp-shortcut
Type: String
Required: False
Default: empty

Added in version 2.4.0.

upnp-shortcut="..."

Set the upnp shortcut label for this container. For more details see UPnP-av-ContentDirectory-v4-Service, page 357.

containers container max-count
Type: Integer
Required: False
Default: 500
max-count="200"

Limit the number of item in dynamic container.

containers container image
Type: Path
Required: False
Default: empty
image="..."

Path to an image to display for the container. It still depends on the client whether the image becomes visible.

1.5.1.2 Dynamic Content Filter

container filter
Type: String
Required: True
<filter>upnp:class derivedfrom "object.item" and last_updated &gt; "@last7"</filter>

Define a filter to run in order to get the contents of the container. The <filter> uses the syntax of UPnP search with additional properties last_modified (date), last_updated (date), upnp:lastPlaybackTime (date), play_group (string, group from client config) and upnp:playbackCount (number). Date properties support comparing against a special value "@last*" where * can be any integer which evaluates to the current time minus the number of days as specified.

UPnP search syntax is defined in