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.