From 0ba513e2879b5e476d4787b333fb82b8dbe2e914 Mon Sep 17 00:00:00 2001 From: Charles Haley <> Date: Sun, 5 Sep 2010 11:01:55 +0100 Subject: [PATCH] Add a comment about not using the Metadata class, and why --- src/calibre/library/server/mobile.py | 4 ++++ src/calibre/library/server/xml.py | 7 ++++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/calibre/library/server/mobile.py b/src/calibre/library/server/mobile.py index 229e0c21c4..6e08581aed 100644 --- a/src/calibre/library/server/mobile.py +++ b/src/calibre/library/server/mobile.py @@ -199,6 +199,10 @@ class MobileServer(object): CKEYS = [key for key in sorted(CFM.get_custom_fields(), cmp=lambda x,y: cmp(CFM[x]['name'].lower(), CFM[y]['name'].lower()))] + # This method uses its own book dict, not the Metadata dict. The loop + # below could be changed to use db.get_metadata instead of reading + # info directly from the record made by the view, but it doesn't seem + # worth it at the moment. books = [] for record in items[(start-1):(start-1)+num]: book = {'formats':record[FM['formats']], 'size':record[FM['size']]} diff --git a/src/calibre/library/server/xml.py b/src/calibre/library/server/xml.py index ed8479980e..5bf2783f96 100644 --- a/src/calibre/library/server/xml.py +++ b/src/calibre/library/server/xml.py @@ -66,6 +66,10 @@ class XMLServer(object): return x.decode(preferred_encoding, 'replace') return unicode(x) + # This method uses its own book dict, not the Metadata dict. The loop + # below could be changed to use db.get_metadata instead of reading + # info directly from the record made by the view, but it doesn't seem + # worth it at the moment. for record in items[start:start+num]: kwargs = {} aus = record[FM['authors']] if record[FM['authors']] else __builtin__._('Unknown') @@ -138,6 +142,3 @@ class XMLServer(object): return etree.tostring(ans, encoding='utf-8', pretty_print=True, xml_declaration=True) - - -