Start downloading books now!
Launch ShelfServer
BookShelf
E-Book reader for iPhone & iPod Touch

Starting with 1.4, ShelfServer will parse metadata on the local filesystem and present it to the client in FileList calls. This allows title, author, cover art, etc. to be specified for formats which wouldn't ordinarily support them.

The metadata must be contained in a filename ending in .meta the same as the book file. For Book.txt, the metadata would be contained in Book.txt.meta. The file itself is a standard Java XML properties file in UTF-8. An example follows:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE properties SYSTEM "http://java.sun.com/dtd/properties.dtd">
<properties>
<entry key="title">Little Brother</entry>
<entry key="author">Doctorow, Cory</entry>
<entry key="identifier">http://craphound.com/littlebrother/download/</entry>
<entry key="language">en</entry>
<entry key="date">2008</entry>
<entry key="description">It’s about growing up in the near future where things have kept going on the way they’ve been going...</entry>
<entry key="rights">Creative Commons Attribution-NoDerivs-NonCommercial 1.0</entry>
<entry key="cover">LittleBrother.txt.jpg</entry>
<entry key="thumb">LittleBrother.txt.jpg</entry>
</properties>

The cover and thumb entries must specify either a full URL to cover art on the web OR a simple filename only. No path information may be included as it would lead to path injection. The file must be stored in the same directory as the book content and the meta file.


Metadata Lite

As many users probably only want a cover image, the stock ShelfServer also provides a simpler way to provide cover art for a book. If the above meta file is present, it will be read instead of the simple way, but absent a meta file, the server will look for cover images in the same directory as a book using the following scheme:

For split books (folder with a number of smaller pieces of the book inside), adding a file named cover.png or cover.jpg along side the rest of the files in the directory will do the trick.

For single file books, the server tries a number of possibilities based on the book's filename. Given a book named MyBook.html, the following images will be tried. The first one found wins.

  • MyBook.html.jpg
  • MyBook.html.cover.jpg
  • MyBook.html.thumb.jpg
  • MyBook.html.png
  • MyBook.html.cover.png
  • MyBook.html.thumb.png
  • MyBook.html.jpeg
  • MyBook.html.cover.jpeg
  • MyBook.html.thumb.jpeg

Note that if both a "thumb" and "cover" version are available, the thumb will be used for the file listing from the ShelfServer (before the book is downloaded), and the cover will be downloaded along with the book and stored on the device. This allows a quick download of a smaller image when looking at a list of files, but still provides higher resolution art which can be viewed by tapping the image in the details window for the book.

Copyright © 2008-2009 Zachary Bedell. All rights reserved.