This is a simple overview of the server.
Hi, you obviously managed to enable
the UI, so I guess you did read the warning already, for the really
ignorant ones - here it is once again :)
WARNING: NEVER RUN THE SERVER ON YOUR EXTERNAL
INTERFACE, ESPECALLY WHEN THE WEB UI IS ENABLED! THE WEB UI PROVIDES
FULL READ ACCESS TO YOUR HOME DIRECTORY, ALLOWING ANYONE ON THE SAME
LAN TO SEE AND DOWNLOAD YOUR DATA!!!
Table of contents:
- Introduction
- Browse Database
- Browse Filesystem
- Active Items
- Icon Reference
Now, let's get started!
There are
two browse modes are available: "Browse Database" and "Browse
Filesystem".
"Browse Database" allows you to have a look at your
database structure, to modify the items and containers and to remove
them.
"Browse Filesystem" allows you to look at the data stored on
your harddrive and add files and directories to the database.
Let's first have a look at the
common things in both modes.
On the top and bottom of the frame you have a drop-down dialog to
select a number of items per page. Additionally, you have an "Add"
field at the bottom. This allows you to quickly add content, no matter
what or where you are browsing. Just make sure, that you use an
absolute path. Note, thtat when you add a directory, it will be done
recursevly so all itmes and subdirectories will be added as well.
"Browse
Database"
Here you can inspect the content of your database and modify it.
Browsing it is no different from browsing the server via a UPnP control
point, however here you have some control over you data.
Click the
icon if you want to modify the properties of your data. Note, that
changes are made only to the server database, the original files on
your system are left untouched.
Click the
icon if you want to add data manually. Usually when you add media, you
either enter a path/filename into the "Add" field, or do it via the
filesystem browser. In this case however, you do everything by hand.
The only really special thing about this is, that this is currently the
only way to add an "Active Item".
Click the
icon to remove media from the database, containers are removed
recursively. Note, that this only removes media from your database, the
original files and directories on your drive are left untouched.
"Browse
Filesystem"
Here you can browse the contents of your drive and directly add files
or directories to the server. Nothing much to say about this.. just hit
the
and
media will be added to the server. Directories are added recursively.
If something on your filesystem has changed while you were browsing it,
you can hit the
icon to refresh the view.
Oh... and I hope you read the security note on top of this page :) If
not READ IT NOW!
Active Items
First of all: this feature is not complete and is currently only
experimental... but it works :)
From UPnP point of view, those are just normal items in the
content directory. However, we allowed ourselves a little trick... when
those items are played (meaning, that an HTTP GET request was done) a
script is executed on the server. The script can be written in any
programming language, there is only one important thing: it reads an
XML from standard input, and writes XML to the standard output. The XML
provides information about the item as well as a special "state". The
script may modify the input XML (change the item name, description,
state) and must write it to stdout. The "state" field is actually just
a string and can be anything you want, the purpose is to let the script
save any auxilary information that is needed for it's purpose. For
example, you could implement "Toggle" items using this feature: for
example, each time you play it, it would change it's name, alternating
between "ON" and "OFF". We included a sample scripts written in Python,
take a look at it (demo_toggle.py) I believe it will be easy to
understand the way this thing works.
Here is an example XML, data that can be changed are marked in white
(when updating the object in the database, only those fields matter)
Script input:
<item
id="104" parentID="102" restricted="1">
<dc:title>Turn ON</dc:title>
<upnp:class>object.item.activeItem</upnp:class>
<dc:description>Your toggle item is turned OFF,
press PLAY to turn it ON.</dc:description>
<res
protocolInfo="http-get:*:image/jpeg:*">http://192.168.0.15:49152/content/media?object%5Fid=104</res>
<action>/home/someuser/scripts/demo_toggle.py</action>
<state>0</state>
<location>/tmp/path/to/picture_1.jpeg</location>
<mime-type>image/jpeg</mime-type>
</item>
Script output:
<item id="104" parentID="102"
restricted="1">
<dc:title>Turn OFF</dc:title>
<upnp:class>object.item.activeItem</upnp:class>
<dc:description>Your toggle item is turned ON,
press PLAY to turn it OFF.</dc:description>
<res
protocolInfo="http-get:*:image/jpeg:*">http://192.168.0.15:49152/content/media?object%5Fid=104</res>
<action>/home/someuser/scripts/demo_toggle.py</action>
<state>1</state>
<location>/tmp/path/to/picture_2.jpeg</location>
<mime-type>image/jpeg</mime-type>
</item>
Icon
Reference:
The table row marked with this icon shows you the full path of your
browse (i.e. your current location in the database)
Add
a new Container, Item or Active Item.
Edit an object in the database
(allows you to change name/mime-type, upnp:class).
Remove an object from the server
database (Note: this does not touch the file/directory on your drive,
it only removes the object from the sqlite3 database).
Add
this file or directory to the database.
Refresh current view of files and
directories.