The Future of Coherence: Backend Options

  1. Backend Options
    1. Configuration Description
    2. Configuration Options
    3. Challenges



Backend Options

Further experimenting with an options system in which the backend itself provides instructions on generating its configuration GUI. Each backend shall provide class attributes descriptions and configuration options, accordingly named _config_description and _config_options.

Note: You should probably wait until these specifications have been finalized and implemented. They may (and probably will) change a bit.

Configuration Description

A tuple containing 3 strings: a formatted name, a backend description, and an optional icon used by the webUI/App UI to generate a superficial list of backends.

Example:

_config_description = ('iRadio', 'Exposes internet radio streams from Shoutcast.', '/path/path/iradio.png')
_config_description = ('Shoutcast TV', "Exposes the list of video streams from Shoutcast TV.', None)

Early Implementation of backend descriptions in which each backend appears as a button leading to its configuration panel.

Configuration Options

A list of option dictionaries with the following values:

option -- Name of that Option

text -- Formatted text label of the UI element

type -- String, int, bool, dir, file

multi -- Indicates if the option type will be a list (optional)

default -- Default value, should be of type type (optional)

enum -- A tuple/list of possible values (optional)

range -- A dict with the minimum value and maximum value (optional)(for type int)

help -- A (short) text describing this option (optional)

level -- The level of this option - normal or advance (optional)

group -- Custom group box to which this option belongs to (optional)


1.) The type dir is a string which is validated as a genuine directory

2.) The type file is a string which is validated as a genuine file

3.) Enum is evaluated once the user tries to save the changes, not while he/she types. Input masks will be supported soon.


Example:

 _config_options = [{'option':'name', 'text':'Server Name:', 'type':'string','default':'my media','help': 'the name under this MediaServer shall show up with on other UPnP clients'},
                    {'option':'version','text':'UPnP Version:','type':'int','default':2,'enum': (2,1),'help': 'the highest UPnP version this MediaServer shall support','level':'advance'},
                    {'option':'uuid','text':'UUID Identifier:','type':'string','help':'the unique (UPnP) identifier for this MediaServer, usually automatically set','level':'advance'},	
                    {'option':'enable_destroy', 'text':'Enable UPnP Deletion:','type':'bool','default':'no','help':'enable deleting a file via an UPnP method'},
                    {'option':'import_folder','text':'UPnP Import Folder:','type':'dir','help':'The path to store files imported via an UPnP method, if empty the Import method is disabled'}
                   ]

Early Implementation of an options panel for FS_Storage

Challenges

1.) Finding a proper equilibrium of flexibility and simplicity.

2.) Implementing complex UI options in a simple yet effective way (Example: A UI components that allows the adding/deleting of directories)