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
This section defines the server configuration parameters.
1.1.1 Server Attributes
- debug-mode
Type: enumRequired:FalseDefault: unsetAdded in version 2.0.0.
Changed in version 2.6.1: new option
inotifyChanged in version 3.0.0: new option
thumbnailerChanged in version 3.0.0: new option
postgresActivate 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,postgresandverbose. Multiple subsystems can be combined with a|. Names are not case sensitive.verboseturns 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
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
-
<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
-
<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
-
<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
-
<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
-
<manufacturer>Gerbera Developers</manufacturer>
This tag sets the manufacturer name of a UPnP device.
1.1.2.6 Manufacturer Url
- manufacturerURL
-
<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
-
<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
-
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
-
<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
-
<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
-
<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
-
<serialNumber>42</serialNumber>
This tag sets the serial number of a UPnP device.
1.1.2.13 Presentation Url
- presentationURL
-
<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: enumRequired:FalseDefault:noneappend-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 ipbut 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
-
<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
-
<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.
1.1.2.16 Temporary Directory
- tmpdir
-
<tmpdir>/tmp/</tmpdir>
Selects the temporary directory that will be used by the server.
1.1.2.17 Web Directory
- webroot
- Type:
PathRequired:TrueDefault: 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:
IntegerRequired:FalseDefault: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
Tweak visibility of PC directory, i.e. root entry for physical structure.
1.1.2.19.1 Attributes
1.1.2.20 Bookmark File
- bookmark
-
<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
-
<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:
SectionRequired:FalseAdded 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
rotate-file-size="1024000"When using command line option
--rotatelogthis value defines the maximum size of the log file before rotating.
- rotate-file-count
rotate-file-count="5"When using command line option
--rotatelogthis value defines the number of files in the log rotation.
1.2 Web Interface
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
enabled="no"Enables (
yes) or disables (no) the web user interface.
- show-tooltips
show-tooltips="no"This setting specifies if icon tooltips should be shown in the web UI.
- show-numbering
show-numbering="no"Set track number to be shown in the web UI.
- show-thumbnail
show-thumbnail="no"This setting specifies if thumbnails or cover art should be shown in the web UI.
- enable-video
enable-video="no"Enable video preview in web ui.
- poll-interval
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
Added in version 2.5.0.
fs-add-item="yes"Show the (deprecated) option to add items without autoscan functionality.
- edit-sortkey
Added in version 2.6.0.
edit-sortkey="yes"Show the edit field
sortKeyfor objects.
- poll-when-idle
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
- source-docs-link
-
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
- user-docs-link
- Type:
StringRequired:FalseDefault: 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:
StringRequired:FalseDefault: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
-
<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
1.2.6 Accounts
- accounts
- Type:
SectionRequired: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
enabled="no"Specifies if accounts are enabled
yesor disabledno.
- session-timeout
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.
1.2.7 Items Per Page
1.2.7.1 Attributes
1.2.7.2 Items
- items-per-page option
<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
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
-
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
-
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
-
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
Defines the SQLite storage driver section.
1.3.2.1 SQLite Attributes
- sqlite3 enabled
-
enabled="no"
Enables SQLite database storage. If SQLite is enabled MySQL must be disabled.
- shutdown-attempts
-
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
-
<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
-
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
-
<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
-
<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
-
<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
-
<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
-
<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
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:
1.3.3 MySQL and MariaDB
Defines the MySQL storage driver section.
1.3.3.1 MySQL Attributes
- mysql enabled
-
enabled="yes"
Enables MySQL database storage. If MySQL is enabled SQLite must be disabled.
1.3.3.2 Server Host
- mysql host
-
<host>localhost</host>
This specifies the host where your MySQL database is running.
1.3.3.3 Server Port
- mysql port
-
<port>0</port>
This specifies the port where your MySQL database is running.
1.3.3.4 Server User
- mysql username
-
<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
-
<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
-
<database>gerbera</database>
Name of the database that will be used by Gerbera.
1.3.3.7 Init SQL File
- mysql init-sql-file
-
<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
-
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
-
<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
-
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
-
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
-
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
Defines the PostgreSQL storage driver section.
1.3.4.1 Postgres Attributes
- postgres enabled
-
enabled="yes"
Enables PostgreSQL database storage. If PostgreSQL is enabled SQLite must be disabled.
1.3.4.2 Server Host
- postgres host
-
<host>localhost</host>
This specifies the host where your PostgreSQL database is running.
1.3.4.3 Server Port
- postgres port
-
<port>0</port>
This specifies the port where your PostgreSQL database is running.
1.3.4.4 Server User
- postgres username
-
<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
-
<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
-
<database>gerbera</database>
Name of the database that will be used by Gerbera.
1.3.4.7 Init SQL File
- postgres init-sql-file
-
<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
-
<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
-
<upgrade-file>/etc/gerbera/postgres-upgrade.xml</upgrade-file>
The full path to the upgrade settings for the database
1.4 UPnP Protocol
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
-
searchable-container-flag="yes"
Only return containers that have the flag searchable set.
- dynamic-descriptions
-
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
-
Added in version 2.0.0.
literal-host-redirection="yes"
Enable literal IP redirection.
- search-result-separator
-
search-result-separator=" : "
String used to concatenate result segments as defined in search-item-result
- multi-value
-
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
-
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
-
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
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.
Add tag to result string.
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
Added in version 2.4.0.
upnp-tag |
meta-data |
|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
- artist-properties
Added in version 2.4.0.
upnp-tag |
meta-data |
|---|---|
|
|
|
|
|
|
- genre-properties
Added in version 2.4.0.
upnp-tag |
meta-data |
|---|---|
|
|
- playlist-properties
Added in version 2.4.0.
upnp-tag |
meta-data |
|---|---|
|
|
- title-properties
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 |
|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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
Add namespace required for properties.
1.4.3.2 Property Content
Define value of an additional property
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
Added in version 2.4.0.
- object-defaults
Added in version 2.4.0.
- container-defaults
-
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.
Defines an UPnP property and the default value of the property.
The attributes specify the property:
UPnP property to define the default. Tags starting with a
@will be generated as an attribute.Default value for the property.
1.5 Dynamic Containers
- containers
-
<containers enabled="yes">
Add dynamic containers to virtual layout.
This section sets the rules for additional containers which have calculated content.
Attributes:
1.5.1 Dynamic Containers Content
- containers container
- Type:
SectionRequired:False<container location="/New" title="Recently added" sort="-last_updated" max-count="500"> <filter>upnp:class derivedfrom "object.item" and last_updated > "@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
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
title="..."Text to display as title of the container. If it is empty the last section of the location is used.
- containers container sort
sort="..."UPnP sort statement to use as sorting criteria for the container.
- containers container upnp-shortcut
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
max-count="200"Limit the number of item in dynamic container.
- containers container image
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:
StringRequired:True<filter>upnp:class derivedfrom "object.item" and last_updated > "@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
UPnP ContentDirectory:1 section 2.5.5,
UPnP ContentDirectory:2 section 2.3.11.1,
UPnP ContentDirectory:3 section 2.3.13.1
and UPnP ContentDirectory:4 section 5.3.16.1.