[Alexandria-list] iPod Notes support [PATCH]

Timothy Malone timothy.malone at gmail.com
Wed Jan 16 22:52:18 EST 2008


Thanks for the comments Cathal and Joseph. 
I fixed the .linx file to include the title tag like you suggested. I
also implemented some code to check for the presence of an image before
trying to link to one. At the very least it should speed up the process
of the iPod checking the note files. I haven't looked into a checkbox
for the user to indicate if their iPod supports photos or not. It should
be possible to get that info from the iPod itself.
The 4K limit is a problem. I guess Alexandria would have to split the
file at some point. That also means creating another directory.
Something to look into I guess.
I also checked and filenames with a '-' in them work just fine.

I do have a question that maybe somebody can answer. Right now, if the
user tries to overwrite a directory that already exists, the file dialog
opens that directory instead of returning it. This makes it impossible
to overwrite a directory. If the user wants to reexport a library they
have to delete it from the iPod first, or choose a different name, which
seems clunky. Is there a way to have the file chooser return a directory
that already exists?

Thanks again.
It's nice to get back into programming. The last time I wrote any code
was probably a few patches I wrote for WindowMaker five or more years
ago. Ruby seems to be a lot more fun to program with than C.

Tim

On Thu, 2008-01-17 at 00:56 +0000, Cathal Mc Ginley wrote:
> On Wed, 16 Jan 2008 14:51:36 -0500
> "Joseph Method" <tristil at gmail.com> wrote:
> 
> > Hi Timothy,
> > 
> > Looks good to me. If you would like to commit it yourself you can
> > email me your Rubyforge username and I'll give you commit rights.
> > 
> > On Jan 16, 2008 2:36 PM, Timothy Malone <timothy.malone at gmail.com>
> > wrote:
> > > So I finally decided that nobody else was gonna code support for
> > > this (especially since I've never asked), and no other Linux
> > > program that I found could do it either, so I bit the bullet and
> > > added it myself. This is a feature that I used to like in Books.app
> > > for the Mac.
> > >
> I'd never heard of iPod Notes (since I don't have an iPod) but this
> looks like a very handy little feature: a hyperlinked list of books to
> carry around with you. I can imagine it being very useful for academic
> reading lists.
> 
> > > It exports your books as iPod note files. It works by making a .linx
> > > file that includes links to each book in your library (they are
> > > given the numerical identifiers that Alexandria uses internally to
> > > avoid filename problems with certain characters (':' for
> > > instance)).
> How about files starting with a '-'? Some of the non-isbn ident's end
> up as negative numbers.
> 
> > >  Each of those notes includes the title, author,
> > > edition, and isbn.
> I looked up the iPod Notes format, and we can touch up the export by
> including <p> tags to keep those fields on separate lines. 
> 
> Also, the index.linx file can have the library name in a <title> tag.
> 
> Individual note files shouldn't be greater than 4kb either... It
> shouldn't be a real concern, though; you'd need several hundred books
> for the index to get that big.
> 
> > > Also, if you have cover images, it will make the
> > > title into a link to the cover image. The iPod should fail
> > > gracefully if a book doesn't have a cover image.
> We can just check in advance for the presence of an image file before
> linking.
> 
> > > The images will
> > > only work on 5th generation and above iPods with firmware version
> > > 1.2 and above. I don't know how earlier iPods will respond (or the
> > > Touch for that matter. Does it even have notes?). Perhaps a
> > > checkbox in the file dialog would be good? Maybe just two export
> > > entries, "iPod Notes with photos" and "iPod Notes without photos".
> > >
> A checkbox would be fine, if this is needed. The export dialog adapts
> dynamically already (for the HTML export, for example).
> 
> > > Also, iPods can only handle 1,000 notes. I'm not sure, but I will
> > > try to find out, if the cover images count towards that total.
> > > Basically, support is somewhat limited. I personally use it to keep
> > > a list of books I am looking for when I go shopping.
> > >
> Tags and Smart Libraries should help here. I mentioned it in the
> manual, but if you tag all the books you're looking for with
> e.g. "shoppinglist", and then create a new Smart Library where "Tags"
> "containss" "shoppinglist", you can export just that smart library.
> You've probably figured this out, but I just thought I'd mention it.
> 
> > > Oh, and this is the first time I've ever even looked at Ruby code,
> > > so please forgive the glaring errors I'm sure I made. Though I must
> > > say I already like Ruby quite a bit. This patch took all of 45
> > > minutes to make, including time spent figuring out how to structure
> > > the iPod Notes. Though mostly I copied code from the other
> > > exporters.
> > >
> A great thing about free software - it's easy to get into: coding by
> imitation is a good way to learn. And while I've been making comments
> on improvements we can make to your code, I must say it's no mean feat
> for your first experiment with a programming language to result in
> adding a useful new feature to a program!
> 
> > > Tim Malone
> 
>    -   Cathal.



More information about the Alexandria-list mailing list