Jump to content

ItemUpdateServiceApi.postItemsByItemid returns "Bad Request"


tstiegler

Recommended Posts

tstiegler

Hi, I want to set season ID's and episode indexes of episodes using Java API call ItemUpdateServiceApi.postItemsByItemid(BaseItemDto body, String itemId). I retrieved the "body" using ItemsServiceApi.getItems(...). But it seems that the returned BaseItemDto doesn't contain all necessary information for the update post because the called end point "GET /items" or "GET /Users/{user_id}/Items/" don't provide the full data set. I need to call "/emby/Users/{user_id}/Items/{item_id}" instead. But what is the java API call to achieve this?

Many thanks,

Thomas

 

Link to comment
Share on other sites

The latest ApiClients can be found here: https://github.com/MediaBrowser/Emby.ApiClients/tree/master

Java ApiClient: https://github.com/MediaBrowser/Emby.ApiClients/tree/master/Clients/Java

The API call you are looking for is in this class: https://github.com/MediaBrowser/Emby.ApiClients/blob/master/Clients/Java/src/main/java/EmbyClient/Java/UserLibraryServiceApi.java

There's a beta branch in this repository which corresponds to the latest beta server.

Link to comment
Share on other sites

tstiegler

Thanks a lot. The exception isn't thrown anymore when using BaseItemDto data = new UserLibraryServiceApi.getUsersByUseridItemsById(...), but season index and and episode index are not updated. I use 

data.setSeasonId(episodeInfo.season.toString());
data.setIndexNumber(episodeInfo.episode);

to set it before calling  new ItemUpdateServiceApi.postItemsByItemid(data, id);

Is this correct?

Thanks, Thomas

Link to comment
Share on other sites

tstiegler

It seems I have found it. I need to call 

data.setParentIndexNumber(episodeInfo.season);
data.setIndexNumber(episodeInfo.episode);

to set season index and episode index.

  • Like 1
  • Thanks 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...