Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > E-Book Software > Calibre > Development

Notices

Reply
 
Thread Tools Search this Thread
Old 04-06-2012, 04:51 PM   #1
synacktic
Junior Member
synacktic began at the beginning.
 
Posts: 1
Karma: 10
Join Date: Apr 2012
Device: Asus Tranformer
Comic Book (CBI) Import Upgrade

Currently here is the function in archive.py to get CBI Metadata:
def get_comic_book_info(d, mi):
# See http://code.google.com/p/comicbookinfo/wiki/Example
series = d.get('series', '')
if series.strip():
mi.series = series
if d.get('volume', -1) > -1:
mi.series_index = float(d['issue'])
if d.get('rating', -1) > -1:
mi.rating = d['rating']
for x in ('title', 'publisher'):
y = d.get(x, '').strip()
if y:
setattr(mi, x, y)
tags = d.get('tags', [])
if tags:
mi.tags = tags
authors = []
for credit in d.get('credits', []):
if credit.get('role', '') in ('Writer', 'Artist', 'Cartoonist',
'Creator'):
x = credit.get('person', '')
if x:
x = ' '.join((reversed(x.split(', '))))
authors.append(x)
if authors:
mi.authors = authors

I am proposing we change it to this:

def get_comic_book_info(d, mi):
# See http://code.google.com/p/comicbookinfo/wiki/Example
series = d.get('series', '')
if series.strip():
mi.series = series
if d.get('issue', -1) > -1:
mi.series_index = float(d['issue'])
if d.get('rating', -1) > -1:
mi.rating = d['rating']
if d.get('publicationMonth', -1) > -1:
month = d['publicationMonth']
else:
month = 1
if d.get('publicationYear', -1) > -1:
mi.pubdate = datetime.date(int(d['publicationYear']),month,1)
for x in ('title', 'publisher'):
y = d.get(x, '').strip()
if y:
setattr(mi, x, y)
tags = d.get('tags', [])
if tags:
mi.tags = tags
authors = []
for credit in d.get('credits', []):
if credit.get('role', '') in ('Writer', 'Inker', 'Creator', 'Editor', 'Cartoonist',
'Colorist', 'Letterer', 'Penciller', 'Penciler', 'Painter', 'Cover', 'Artist'):
x = credit.get('person', '')
if x:
x = ' '.join((reversed(x.split(', '))))
authors.append(x)
if authors:
mi.authors = authors


Basically I added:
publication date
better "role" support
changed the numbers for series_index to come from issue, not volume

I know the last one might be questionable. Being comic books, the series often matters followed by which comic it is, so setting this to issue makes more sense. I would be glad to make it some sort of a issue when volume not set or something (I guess trade comics might be better labeled with a volume). Either way. If it must be left as volume, I'll just edit the CBI before import. I am mainly concerned with the publishing date, everything else I could live without, but thought I would toss it out there.

So, let me know and we can discuss. Once it is decided either someone can plug it in or I can create a patch if you like.
synacktic is offline   Reply With Quote
Old 04-07-2012, 12:49 AM   #2
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 25,445
Karma: 4961459
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Can you post that as a patch. I'd rather not change series_index. You can make it failover to issue when volume is not set if you like.
kovidgoyal is online now   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Comic Book Options Scarpad Kindle Fire 17 12-19-2011 05:41 PM
Comic Book Recommendations? stonetools Reading Recommendations 38 11-14-2011 11:24 PM
Android Comic Book question utmotmar enTourage Archive 6 08-22-2010 08:40 AM
Dr. Horrible comic book now available Nate the great General Discussions 1 03-31-2010 09:48 PM
This looks like a wonderfully comic ZOMBIE book that's very NOVEL Dr. Drib Reading Recommendations 16 07-21-2009 02:56 PM


All times are GMT -4. The time now is 09:47 AM.


MobileRead.com is a privately owned, operated and funded community.