'Add the object to the library database. This object must be
associated with a database; you can provide one via the `db`
parameter or use the currently associated database.
The object\'s `id` and `added` fields are set along with any
current field values.'

def add(self, db=None):

    if db:
        self._db = db
    self._check_db(False)
    with self._db.transaction() as tx:
        new_id = tx.mutate('INSERT    INTO    {0}    DEFAULT    VALUES'.format(self._table))
        self.id = new_id
        self.added = time.time()
        for key in self:
            if (self[key] is not None):
                self._dirty.add(key)
        self.store()
