def set_identifier(self, book_id, typ, val, notify=True, commit=True): with self.new_api.write_lock: identifiers = self.new_api._field_for('identifiers', book_id) typ, val = clean_identifier(typ, val) if typ: identifiers[typ] = val self.new_api._set_field('identifiers', {book_id: identifiers}) self.notify('metadata', [book_id])
def set_identifier(self, book_id, typ, val, notify=True, commit=True): with self.new_api.write_lock: identifiers = self.new_api._field_for('identifiers', book_id) typ, val = clean_identifier(typ, val) if typ: identifiers[typ] = val self.new_api._set_field('identifiers', {book_id:identifiers}) self.notify('metadata', [book_id])