Search the Community
Showing results for tags 'itemupdateservice'.
-
ItemUpdateService : POST /Items/{ItemId} failes with 204
NoEmbyNoFun posted a topic in Developer API
Hello all I'd like to update an item (a movie) using the code pattern from PenkethBoy ( Setting Folder Sort Sequence via API - Developer API - Emby Community ) The information is fetched using GET /emby/{UserId}/items/{ItemId}. Then exactly two pieces of information are changed: UserData.PlayCount and UserData.Played. Then the information should be updated using POST /emby/items/{ItemId}. # edit item $item.UserData.Played = $true $item.UserData.PlayCount = 1 # update item $url = $es + "/Items/73667?api_key=" + $ac $result = Invoke-Webrequest -uri $url -Method POST -Body ( $item | ConvertTo-Json ) -ContentType "application/json; charset=utf-8" # returns StatusCode : 204 StatusDescription : No Content Content : {} ... Unfortunately this POST does not work as hoped. It returns 204 with no content and the item is not updated. In the Swagger UI the code 204 is not explained. In this forum I didn't find anything about it. Also in the wiki I found no hints regarding updating of items. What am I missing? (The user has the right to manage the emby server). Is there any further documentation? Many thanks in advance for any hint. Dani (Environment: Emby 4.5.4.0, Powershell-Script on Windows 10) -
Two problems: 1. problems with updating an item 2. hard to debug the above i.e. hard to read log file. I wanted to update an item but I didn't know which fields to include so started with only the field I wanted to change i.e. sortTitle. I was receiving http 400 and there were nullpointers in the log file but the stacktrace does not contain line numbers!!! I carefully analysed source file and found that I have no ProviderIds nor Tags. After filling these now the server response is 500 and the log file says: System.NullReferenceException: Object reference not set to an instance of an object. at Emby.Server.Implementations.Data.SqliteItemRepository.SaveItem(BaseItem item, BaseItem topParent, String userDataKey, IStatement saveItemStatement) the item I want to update: {"SortName":"abcd","ProviderIds":[],"Tags":[]} emby version: 3.4.1.35 2. please add line numbers to stacktrace 1. are there any code snippets or json examples of using emby api?
- 21 replies
-
- embyserver.txt
- ItemUpdateService
-
(and 1 more)
Tagged with: