

Only when i get into the viewer it gets recognized, and I'm able to retrieve it's metadata.
Hello!
I'm trying to use the python pyzotero API to upload my EPUBS and then retrieve the metadata from them.
This process should be automatically done with the following:
```
var win = Zotero.getMainWindow();```
var menu = win.document.getElementById('zotero-itemmenu');
var btn = menu.querySelector('[label="Retrieve Metadata"]');
if (btn) {
if (typeof btn.doCommand === 'function') {
btn.doCommand();
} else {
btn.click();
}
}
var items = Zotero.getActiveZoteroPane().getSelectedItems();
return items;
But after uploading it looks like this:
making me unable to retrieve metadata from it
and not like this:
Only when i get into the viewer it gets recognized, and I'm able to retrieve it's metadata.
Here's the code on how I upload my EPUB:
```
template = zot.item_template('book')
book_res = zot.create_items([template])
if book_res['successful']:
book_item = book_res['successful']['0']
book_key = book_item['key']
zot.attachment_simple([book_path], book_key)
```