mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
...
This commit is contained in:
parent
cc0f8f4323
commit
458727a560
@ -125,7 +125,10 @@ class Metadata(object):
|
|||||||
_data = object.__getattribute__(self, '_data')
|
_data = object.__getattribute__(self, '_data')
|
||||||
if field in TOP_LEVEL_IDENTIFIERS:
|
if field in TOP_LEVEL_IDENTIFIERS:
|
||||||
field, val = self._clean_identifier(field, val)
|
field, val = self._clean_identifier(field, val)
|
||||||
_data['identifiers'].update({field: val})
|
identifiers = _data['identifiers']
|
||||||
|
identifiers.pop(field, None)
|
||||||
|
if val:
|
||||||
|
identifiers[field] = val
|
||||||
elif field == 'identifiers':
|
elif field == 'identifiers':
|
||||||
if not val:
|
if not val:
|
||||||
val = copy.copy(NULL_VALUES.get('identifiers', None))
|
val = copy.copy(NULL_VALUES.get('identifiers', None))
|
||||||
@ -224,8 +227,7 @@ class Metadata(object):
|
|||||||
identifiers = object.__getattribute__(self,
|
identifiers = object.__getattribute__(self,
|
||||||
'_data')['identifiers']
|
'_data')['identifiers']
|
||||||
|
|
||||||
if not val and typ in identifiers:
|
identifiers.pop(typ, None)
|
||||||
identifiers.pop(typ)
|
|
||||||
if val:
|
if val:
|
||||||
identifiers[typ] = val
|
identifiers[typ] = val
|
||||||
|
|
||||||
@ -647,7 +649,7 @@ class Metadata(object):
|
|||||||
fmt('Tags', u', '.join([unicode(t) for t in self.tags]))
|
fmt('Tags', u', '.join([unicode(t) for t in self.tags]))
|
||||||
if self.series:
|
if self.series:
|
||||||
fmt('Series', self.series + ' #%s'%self.format_series_index())
|
fmt('Series', self.series + ' #%s'%self.format_series_index())
|
||||||
if self.language:
|
if not self.is_null('language'):
|
||||||
fmt('Language', self.language)
|
fmt('Language', self.language)
|
||||||
if self.rating is not None:
|
if self.rating is not None:
|
||||||
fmt('Rating', self.rating)
|
fmt('Rating', self.rating)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user