mirror of
git://github.com/kovidgoyal/calibre.git
synced 2026-05-09 11:14:02 +02:00
Fix #8797 (calibre tries to create a faulty path from the meta data (exception))
This commit is contained in:
parent
ef51c4d198
commit
b82399e305
1 changed files with 5 additions and 1 deletions
|
|
@ -432,7 +432,11 @@ def construct_path_name(self, id):
|
|||
authors = _('Unknown')
|
||||
author = ascii_filename(authors.split(',')[0])[:self.PATH_LIMIT].decode(filesystem_encoding, 'replace')
|
||||
title = ascii_filename(self.title(id, index_is_id=True))[:self.PATH_LIMIT].decode(filesystem_encoding, 'replace')
|
||||
path = author + '/' + title + ' (%d)'%id
|
||||
while author[-1] in (' ', '.'):
|
||||
author = author[:-1]
|
||||
if not author:
|
||||
author = ascii_filename(_('Unknown')).decode(filesystem_encoding, 'replace')
|
||||
path = author + '/' + title + ' (%d)'%id
|
||||
return path
|
||||
|
||||
def construct_file_name(self, id):
|
||||
|
|
|
|||
Loading…
Reference in a new issue