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; */
|
||||
}
|
||||
|
||||
table.cbj_header tr.cbj_pubdate {
|
||||
/* Uncomment the next line to remove 'Published' from banner section */
|
||||
table.cbj_header tr.cbj_pubdata {
|
||||
/* Uncomment the next line to remove 'Published (year of publication)' from banner section */
|
||||
/* display:none; */
|
||||
}
|
||||
|
||||
|
@ -109,7 +109,7 @@ def get_rating(rating, rchar, e_rchar):
|
||||
|
||||
def render_jacket(mi, output_profile,
|
||||
alt_title=_('Unknown'), alt_tags=[], alt_comments='',
|
||||
alt_publisher=('Unknown publisher')):
|
||||
alt_publisher=('')):
|
||||
css = P('jacket/stylesheet.css', data=True).decode('utf-8')
|
||||
|
||||
try:
|
||||
@ -127,7 +127,7 @@ def render_jacket(mi, output_profile,
|
||||
try:
|
||||
publisher = mi.publisher if mi.publisher else alt_publisher
|
||||
except:
|
||||
publisher = _('Unknown publisher')
|
||||
publisher = ''
|
||||
|
||||
try:
|
||||
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">
|
||||
aTag = body.find('a', attrs={'class':'series_id'})
|
||||
if book['series']:
|
||||
if self.opts.generate_series:
|
||||
aTag['href'] = "%s.html#%s_series" % ('BySeries',
|
||||
re.sub('\W','',book['series']).lower())
|
||||
else:
|
||||
aTag.extract()
|
||||
if aTag:
|
||||
if book['series']:
|
||||
if self.opts.generate_series:
|
||||
aTag['href'] = "%s.html#%s_series" % ('BySeries',
|
||||
re.sub('\W','',book['series']).lower())
|
||||
else:
|
||||
aTag.extract()
|
||||
|
||||
# Insert the author link (always)
|
||||
# Insert the author link
|
||||
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",
|
||||
self.generateAuthorAnchor(book['author']))
|
||||
|
||||
if publisher == ' ':
|
||||
try:
|
||||
publisherTag = body.find('td', attrs={'class':'publisher'})
|
||||
publisherTag = body.find('td', attrs={'class':'publisher'})
|
||||
if publisherTag:
|
||||
publisherTag.contents[0].replaceWith(' ')
|
||||
except:
|
||||
pass
|
||||
|
||||
if not genres:
|
||||
try:
|
||||
genresTag = body.find('p',attrs={'class':'genres'})
|
||||
genresTag = body.find('p',attrs={'class':'genres'})
|
||||
if genresTag:
|
||||
genresTag.extract()
|
||||
except:
|
||||
pass
|
||||
|
||||
if not formats:
|
||||
try:
|
||||
formatsTag = body.find('p',attrs={'class':'formats'})
|
||||
formatsTag = body.find('p',attrs={'class':'formats'})
|
||||
if formatsTag:
|
||||
formatsTag.extract()
|
||||
except:
|
||||
pass
|
||||
|
||||
if note_content == '':
|
||||
try:
|
||||
tdTag = body.find('td', attrs={'class':'notes'})
|
||||
tdTag = body.find('td', attrs={'class':'notes'})
|
||||
if tdTag:
|
||||
tdTag.contents[0].replaceWith(' ')
|
||||
except:
|
||||
pass
|
||||
|
||||
emptyTags = body.findAll('td', attrs={'class':'empty'})
|
||||
for mt in emptyTags:
|
||||
|
Loading…
x
Reference in New Issue
Block a user