mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-06-23 15:30:45 -04:00
Fix #8780 (Don't Show "Unknown Publisher")
This commit is contained in:
commit
f35540a91d
@ -113,8 +113,8 @@ table.cbj_header tr.cbj_series {
|
|||||||
/* display:none; */
|
/* display:none; */
|
||||||
}
|
}
|
||||||
|
|
||||||
table.cbj_header tr.cbj_pubdate {
|
table.cbj_header tr.cbj_pubdata {
|
||||||
/* Uncomment the next line to remove 'Published' from banner section */
|
/* Uncomment the next line to remove 'Published (year of publication)' from banner section */
|
||||||
/* display:none; */
|
/* display:none; */
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -109,7 +109,7 @@ def get_rating(rating, rchar, e_rchar):
|
|||||||
|
|
||||||
def render_jacket(mi, output_profile,
|
def render_jacket(mi, output_profile,
|
||||||
alt_title=_('Unknown'), alt_tags=[], alt_comments='',
|
alt_title=_('Unknown'), alt_tags=[], alt_comments='',
|
||||||
alt_publisher=('Unknown publisher')):
|
alt_publisher=('')):
|
||||||
css = P('jacket/stylesheet.css', data=True).decode('utf-8')
|
css = P('jacket/stylesheet.css', data=True).decode('utf-8')
|
||||||
|
|
||||||
try:
|
try:
|
||||||
@ -127,7 +127,7 @@ def render_jacket(mi, output_profile,
|
|||||||
try:
|
try:
|
||||||
publisher = mi.publisher if mi.publisher else alt_publisher
|
publisher = mi.publisher if mi.publisher else alt_publisher
|
||||||
except:
|
except:
|
||||||
publisher = _('Unknown publisher')
|
publisher = ''
|
||||||
|
|
||||||
try:
|
try:
|
||||||
pubdate = strftime(u'%Y', mi.pubdate.timetuple())
|
pubdate = strftime(u'%Y', mi.pubdate.timetuple())
|
||||||
|
@ -4442,46 +4442,39 @@ then rebuild the catalog.\n''').format(author[0],author[1],current_author[1])
|
|||||||
|
|
||||||
# Insert the link to the series or remove <a class="series">
|
# Insert the link to the series or remove <a class="series">
|
||||||
aTag = body.find('a', attrs={'class':'series_id'})
|
aTag = body.find('a', attrs={'class':'series_id'})
|
||||||
if book['series']:
|
if aTag:
|
||||||
if self.opts.generate_series:
|
if book['series']:
|
||||||
aTag['href'] = "%s.html#%s_series" % ('BySeries',
|
if self.opts.generate_series:
|
||||||
re.sub('\W','',book['series']).lower())
|
aTag['href'] = "%s.html#%s_series" % ('BySeries',
|
||||||
else:
|
re.sub('\W','',book['series']).lower())
|
||||||
aTag.extract()
|
else:
|
||||||
|
aTag.extract()
|
||||||
|
|
||||||
# Insert the author link (always)
|
# Insert the author link
|
||||||
aTag = body.find('a', attrs={'class':'author'})
|
aTag = body.find('a', attrs={'class':'author'})
|
||||||
if self.opts.generate_authors:
|
if self.opts.generate_authors and aTag:
|
||||||
aTag['href'] = "%s.html#%s" % ("ByAlphaAuthor",
|
aTag['href'] = "%s.html#%s" % ("ByAlphaAuthor",
|
||||||
self.generateAuthorAnchor(book['author']))
|
self.generateAuthorAnchor(book['author']))
|
||||||
|
|
||||||
if publisher == ' ':
|
if publisher == ' ':
|
||||||
try:
|
publisherTag = body.find('td', attrs={'class':'publisher'})
|
||||||
publisherTag = body.find('td', attrs={'class':'publisher'})
|
if publisherTag:
|
||||||
publisherTag.contents[0].replaceWith(' ')
|
publisherTag.contents[0].replaceWith(' ')
|
||||||
except:
|
|
||||||
pass
|
|
||||||
|
|
||||||
if not genres:
|
if not genres:
|
||||||
try:
|
genresTag = body.find('p',attrs={'class':'genres'})
|
||||||
genresTag = body.find('p',attrs={'class':'genres'})
|
if genresTag:
|
||||||
genresTag.extract()
|
genresTag.extract()
|
||||||
except:
|
|
||||||
pass
|
|
||||||
|
|
||||||
if not formats:
|
if not formats:
|
||||||
try:
|
formatsTag = body.find('p',attrs={'class':'formats'})
|
||||||
formatsTag = body.find('p',attrs={'class':'formats'})
|
if formatsTag:
|
||||||
formatsTag.extract()
|
formatsTag.extract()
|
||||||
except:
|
|
||||||
pass
|
|
||||||
|
|
||||||
if note_content == '':
|
if note_content == '':
|
||||||
try:
|
tdTag = body.find('td', attrs={'class':'notes'})
|
||||||
tdTag = body.find('td', attrs={'class':'notes'})
|
if tdTag:
|
||||||
tdTag.contents[0].replaceWith(' ')
|
tdTag.contents[0].replaceWith(' ')
|
||||||
except:
|
|
||||||
pass
|
|
||||||
|
|
||||||
emptyTags = body.findAll('td', attrs={'class':'empty'})
|
emptyTags = body.findAll('td', attrs={'class':'empty'})
|
||||||
for mt in emptyTags:
|
for mt in emptyTags:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user