How to output an index in MediaServer


The information on this page is for people who want to generate HTML files for MediaServer themselves.
(For engineers/advanced users)

General users should use the MediaServer and PHP scripts available at Download Page.

Also, if WebDAV is supported, an index is not necessary.
(Enable WebDAV in ComicGlass server registration settings)

How to create index HTML

MediaServer automatically extracts a list of books from HTML.
Because it is not fully RFC-compliant, extraction may fail if there are things like Javascript or nested comments.
Output it in as simple a form as possible.
  • File names must be percent-encoded (RFC3986).
  • The HTML character encoding must be UTF-8.
    If the file system is not UTF-8, you can handle it by specifying the booktitle attribute described later.
  • Whether something is a book or a folder is determined by its extension.
    To have it treated as a book regardless of extension, see "Specify as a book file" below.

Specifying the title

The book title uses the file name as-is.
You can also specify a display name different from the actual file name by adding an attribute named booktitle within the A element tag.
If this attribute is specified, the file name saved after download will also be this name.
(Using this feature makes it easy to generate an index list even if the file system is not UTF-8.
However, be sure to percent-encode the file name.)

Specifying the file size

As with the title, adding the booksize attribute allows you to display the file size to users.
Since it is used only for display, it does not affect other behavior.

Specifying the file modification date and time

As with the title, adding the bookdate attribute lets you specify the modification date for books and folders.
This field is used for sorting. The value is POSIX time.

Specify as a book file

If you specify bookfile="true", it will be treated as a book even if it has no extension.
You cannot specify "false".

cgexpand attribute

Used when expanding streaming on the server side. Do not specify it.