Fix bug #3567: Limit text length used for TXT metadata.

This commit is contained in:
John Schember 2009-09-23 19:51:28 -04:00
parent 0956c683f0
commit 72fd1a1d59

View File

@ -22,6 +22,8 @@ def get_metadata(stream, extract_cover=True):
else:
mdata += line
mdata = mdata[:100]
mo = re.search('(?u)^[ ]*(?P<title>.+)[ ]*(\n{3}|(\r\n){3}|\r{3})[ ]*(?P<author>.+)[ ]*(\n|\r\n|\r)$', mdata)
if mo != None:
mi.title = mo.group('title')