better filenames
This commit is contained in:
parent
db8a3f2689
commit
82d11e412f
1 changed files with 3 additions and 0 deletions
|
@ -576,6 +576,8 @@ class File(db.Model):
|
|||
author = '; '.join([get_sort_name(a) for a in j.get('author', [])])
|
||||
if not author:
|
||||
author = 'Unknown Author'
|
||||
if ' (Ed.)' in author:
|
||||
author = author.replace(' (Ed.)', '') + ' (Ed.)'
|
||||
title = j.get('title', 'Untitled')
|
||||
extension = j['extension']
|
||||
|
||||
|
@ -593,6 +595,7 @@ class File(db.Model):
|
|||
if date and len(date) >= 4:
|
||||
extra += ' ' + date[:4]
|
||||
if extra:
|
||||
extra = format_underscores(extra)
|
||||
title = '%s (%s)' % (title, extra.strip())
|
||||
filename = '%s.%s' % (title, extension)
|
||||
first = unicodedata.normalize('NFD', author[0].upper())[0].upper()
|
||||
|
|
Loading…
Reference in a new issue