Page 1 of 1

REST Library Update

PostPosted: Fri Mar 23, 2012 4:31 am
by jhb50
When using PUT /rest/repository I assume you must provide the data for the complete library, and not just the sections that have changes.

Second question, can the ID's be in random order or must they be sequential, in other words if I want to reorder the items can I just alter the ids or do i need to move the whole <onlineRepository> section.

Third question, if I want to delete an item do I need to renumber all following section ids so there is no gap?

Fourth question, if i want to add an item( id left blank) can the be anywhere in the sequence or just at the end.

Fifth question, once a feed is added does it keep the same id until it is deleted or does Serviio renumber the ids dynamically as required. I want to automate refresh of some feeds so I need a locked in id for forceOnlineResourceRefresh

Re: REST Library Update

PostPosted: Fri Mar 23, 2012 8:20 am
by will
1) You must provide a complete copy of how the library should look you need to GET /rest/repository, make your changes and then PUT /rest/repository

2) The ID is for internal use, the client doesn't/shouldn't/cannot change them. Moving the order of data before sending it back does nothing, except if there are new items

3) No, just remove the item

4) Think you can add it anywhere, it doesn't really matter unless you are adding multiple shows I guess, I shove it at the end

5) It keeps the same ID as far as I rememeber

What are you trying to do, I'm guessing a small utility/script rather than a full app? If so, you still might as well grab a new copy of the repository and check against that rather than keeping track of ids yourself so that you can refresh an online source