mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Make getattr(mi, '#series_index') work, in addition to mi.get( '#series_index') which already worked.
This commit is contained in:
parent
6c6b2aa256
commit
1243bc0c2d
@ -120,7 +120,11 @@ class Metadata(object):
|
||||
_('TEMPLATE ERROR'),
|
||||
self).strip()
|
||||
return val
|
||||
|
||||
if field.startswith('#') and field.endswith('_index'):
|
||||
try:
|
||||
return self.get_extra(field[:-6])
|
||||
except:
|
||||
pass
|
||||
raise AttributeError(
|
||||
'Metadata object has no attribute named: '+ repr(field))
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user