Mmmmm... I still have some problems.
I change my strategy, and instead of using db.set_metadata(), I'm using db.set_title(), db.set_authors(), db.set_series(), etc.
But I still have a problem when using db.set_series(). If I update series in some books, I have some errors at debug window (get categories: item xxx is not in series list - xxx is series name).
I think this errors are because I'm changing series at the metadata of a book who shares series with others books. Maybe I need to do some thing after setting series to refresh series in other books?