Hacking Alexandria to Support E-books
I love books, I have thousands of them! One big problem for me has been in managing my book collection. Until recently there did not seem to be any efficient solutions for managing my e-book collection. I have played with all the usual solutions, but everything seemed overly complicated, difficult, or large. Nothing native to Linux, or to Gnome which is my window manager of choice. All I wanted was a simple browser for my books that would allow me to quickly find the one I was interested in reading so I could read it.
So looking over things I found Alexandria, a book manager for Gnome. It's a neat book manager with interesting features, however it lacks support for e-books. It also seems the author is developing a fork so can't be bothered to add support to the existing application. So I decided to put my ruby skills to the test and hack the application to add support for attaching files to books and it worked -- great!


A few things that I had to do... I had to update the existing UI using Glade. Then update the UI. One thing which is interesting is how Ruby's data models work. Alexandria uses YAML in order to store the information. The configuration file is automatically generated using the model for the book. In order to add a new field to the book, one simply had to open up book.rb and add the new field to the field definitions and the constructor. Then edit the file responsible for the specific dialog to make sure the book model takes the entry field and saves it to the book model before the model is saved. Anyhow, a few hours of work.
The patch included is not finished and it is against the trunk as of July 16th, 2009. It does work however and I have e-mailed the main maintainer of the project to ask him to look over the patch.
TODO:
- Fix all providers with new model
- Resize the images to an equal size to make sure they line up properly.
- Move all books to a central location and use retrieved fields to rename them
UPDATE:
This now has its own branch and will end up in the 0.7 release of Alexandria.
http://alexandria.rubyforge.org/svn/branches/alexandria/0.7.0-etopian/al...