Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Zotero.addto_collection(collection, item) #71

Closed
retorquere opened this issue Aug 12, 2019 · 7 comments
Closed

Zotero.addto_collection(collection, item) #71

retorquere opened this issue Aug 12, 2019 · 7 comments
Labels

Comments

@retorquere
Copy link

Add the specified item(s) to the specified collection

@bjohas bjohas added the prio-2 label Aug 12, 2019
@bjohas bjohas added prio-1 and removed prio-2 labels Nov 7, 2019
@bjohas
Copy link

bjohas commented Nov 7, 2019

We would like to be able to add a set of items to a specific collection, e.g.

zotero-cli addtocollection --collection ABC item1 [item2 [item3 ...]]

which would add items1 (2, 3, ...) to collection ABC.

@retorquere
Copy link
Author

with items being? Individual JSON documents such as fetched with items --top? Arrays of such (which is what the items call would usually return)?

Would this create the items, or merely assign existing items to existing collections?

How should nested collections be specified (keeping in mind that Zotero allows same-name collections on the same level)?

@retorquere retorquere changed the title Zotero.addto\_collection(collection, item) Zotero.addto_collection(collection, item) Nov 7, 2019
@bjohas
Copy link

bjohas commented Nov 8, 2019

The Zotero collection should be describe as the ID of the collection (e.g. fetched with the additions you did for Zutilo).

Items should be specified as item IDs, i.e. libraryID:ittemID.

See also #90

@retorquere
Copy link
Author

The API doesn't know about itemIDs, it only knows itemKeys, and you don't need to specify a libraryID because items can only be added to collections that are part of the same library.

Specifying via key means I must download the item and patch it, so there's a round-trip involved, and it can fail if someone has changed the item between the fetch and the patch.

@retorquere
Copy link
Author

Is there a collection and items I can test with safely?

@retorquere
Copy link
Author

You can try 1.0.2

@bjohas
Copy link

bjohas commented Jan 12, 2020

Thank you!

All working. I made a small tweak (as well as some redundant changes that I then undid).

Many thanks!

@bjohas bjohas closed this as completed Jan 12, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants