Configuring multiple shares in DLNA server setup causes miniDLNA server to fail

Issue #412 resolved
prl created an issue

If you have more than one share configured in miniDLNA, the miniDLNA server doesn't start.

The problem is that when there are 2 or more shares, /etc/minidlna.conf contains something like:

media_dir=/media/hdd/movie/, /media/hdd/music/, /media/hdd/pictures/

The comments in /etc/minidlna.conf suggests that there should be multiple "media_dir" lines.

media_dir=/media/hdd/movie/
media_dir=/media/hdd/music/
media_dir=/media/hdd/pictures/

If /etc/minidlna.conf is edited so that there are multiple "media_dir" the miniDLNA server starts correctly.

Replication steps

Go to MENU>Setup>Setwork>Network services>DLNA server, then MENU, GREEN Shares.

In the selector, select more than one directory with YELLOW Select, then Green SAVE, then RED Save in the Mini DLNA MENU setup screen.

Then in the main Mini DLNA setup screen, GREEN Stop and then GREEN Start. After the GREEN Start, "Current Status" remains Stopped, and the log in /var/logs/minidlna.log does not show the miniDLNA server as having started (logging setup requires the configuration file to be read before logging starts).

If /etc/minidlna.conf is edited so that there are multiple "media_dir" lines as above, restarting the miniDLNA server works, and the log shows the media directories as being scanned (you need to wait for the scanning to complete).

Comments (2)

  1. prl reporter

    Two additional things that need to be fixed at the same time:

    • If you do MENU, RED Save, from MENU>Setup>Setwork>Network services>DLNA server the "media_dir" setting value is removed (i.e. media_dir=).

    • From MENU>Setup>Setwork>Network services>DLNA server, MENU, GREEN Shares should have ticks on directories that are already in the "media_dir" settings.

  2. Peter Urbanec

    Fix bug #412: Configuring multiple shares in DLNA server setup causes miniDLNA server to fail

    Read/write multiple share directories as multiple "media_dir=" lines with one directory/line instead of a single comma-separated list.

    Fixes bug where if MENU is pressed from the status screen, then RED Save immediately, empty "media_dir=" entries wuld be written.

    Fixed bug that the initial settings for "media_dir=" are not ticked in the shares selector. MiniDLNASelection.init() used line[11:] to extrract the falue from "media_dir=" lines, should have been line[10:].

    Fixed initialisation of config.networkminidlna.mediafolders, should be [], not "".

    Change multiple separate "/etc/minidlna.conf" strings to use a single global.

    Use mkstemp() for the temporary file when re-writing /etc/minidlna.conf.

    Fix typo ("Share Folder's").

    → <<cset 59dca1e4f256>>

  3. Log in to comment