GwR fix for ratings

This commit is contained in:
GRiker 2011-01-02 14:14:29 -07:00
parent 089f785d93
commit 32a2993c76
2 changed files with 20 additions and 8 deletions

View File

@ -14,10 +14,10 @@
<table width="100%" border="0">
<tr>
<td class="thumbnail" rowspan="7"></td>
<td>&#160;</td>
<td></td>
</tr>
<tr>
<td>&#160;</td>
<td></td>
</tr>
<tr>
<td class="publisher">{publisher}</td>
@ -32,7 +32,7 @@
<td class="notes">{note_source}: {note_content}</td>
</tr>
<tr>
<td>&#160;</td>
<td></td>
</tr>
</table>
<hr class="description_divider" />

View File

@ -4393,21 +4393,21 @@ class EPUB_MOBI(CatalogPlugin):
'''
# Publisher
publisher = NBSP
publisher = ''
if 'publisher' in book:
publisher = book['publisher']
# Rating
stars = int(book['rating']) / 2
rating = NBSP
rating = ''
if stars:
star_string = self.FULL_RATING_SYMBOL * stars
empty_stars = self.EMPTY_RATING_SYMBOL * (5 - stars)
rating = '%s%s <br/>' % (star_string,empty_stars)
# Notes
note_source = NBSP
note_content = NBSP
note_source = ''
note_content = ''
if 'notes' in book:
note_source = book['notes']['source']
note_content = book['notes']['content']
@ -4449,7 +4449,7 @@ class EPUB_MOBI(CatalogPlugin):
formatsTag = body.find('p',attrs={'class':'formats'})
formatsTag.extract()
if note_content == NBSP:
if note_content == '':
tdTag = body.find('td', attrs={'class':'notes'})
tdTag.contents[0].replaceWith(NBSP)
@ -4463,6 +4463,18 @@ class EPUB_MOBI(CatalogPlugin):
imgTag['alt'] = "cover thumbnail"
tdTag.insert(0,imgTag)
'''
# Rating
stars = int(book['rating']) / 2
rating = ''
if stars:
star_string = self.FULL_RATING_SYMBOL * stars
empty_stars = self.EMPTY_RATING_SYMBOL * (5 - stars)
rating = '%s%s <br/>' % (star_string,empty_stars)
ratingTag = body.find('td',attrs={'class':'rating'})
ratingTag.insert(0,NavigableString(rating))
'''
# The Blurb
if 'description' in book and book['description'] > '':
blurbTag = body.find(attrs={'class':'description'})