Jump to content

Delete item via API fails


Glueckstiger

Recommended Posts

Glueckstiger

Hi,

I am building an app (Laravel) to list and delete watched episodes. Requesting played items via API works, but deleting doesnt. Why?

Item id 178447 comes from prior /Users/<id>/Items request... And my emby server lives on a synology NAS.

Quote

2022-02-21 14:08:23.807 Info Server: http/1.1 DELETE http://192.168.178.23:8096/Items/178447. UserAgent: insomnia/2021.7.2
2022-02-21 14:08:23.810 Error Server: Error processing request
    *** Error Report ***
    Version: 4.6.7.0
    Command line: /volume1/@appstore/EmbyServer/system/EmbyServer.dll -programdata /var/packages/EmbyServer/var -ffdetect /var/packages/EmbyServer/target/bin/ffdetect -ffmpeg /var/packages/EmbyServer/target/bin/ffmpeg -ffprobe /var/packages/EmbyServer/target/bin/ffprobe -nolocalportconfig -ignore_vaapi_enabled_flag -pidfile /var/packages/EmbyServer/var/EmbyServer.pid -defaultdirectory /volume1/Public -updatepackage emby-server-synology7_{version}_x86_64.spk -noautorunwebapp
    Operating system: Linux version 4.4.180+ (root@build15) (gcc version 7.5.0 (GCC) ) #42218 SMP Mon Oct 18 19:17:56 CST 2021
    Framework: .NET Core 3.1.21
    OS/Process: x64/x64
    Runtime: volume1/@appstore/EmbyServer/system/System.Private.CoreLib.dll
    Processor count: 4
    Data path: /var/packages/EmbyServer/var
    Application path: /volume1/@appstore/EmbyServer/system
    System.NullReferenceException: System.NullReferenceException: Object reference not set to an instance of an object.
       at MediaBrowser.Controller.Entities.BaseItem.IsAuthorizedToDelete(User user, Folder[] collectionFolders)
       at MediaBrowser.Api.Library.LibraryService.Delete(DeleteItems request)
       at MediaBrowser.Api.Library.LibraryService.Delete(DeleteItem request)
       at Emby.Server.Implementations.Services.ServiceController.<>c__DisplayClass6_0.<VoidActionDelegate>b__0(Object service, Object request)
       at Emby.Server.Implementations.Services.ServiceController.Execute(HttpListenerHost appHost, Object requestDto, IRequest req)
       at Emby.Server.Implementations.Services.ServiceHandler.ProcessRequestAsync(HttpListenerHost appHost, IRequest httpReq, IResponse httpRes, RestPath restPath, String responseContentType, CancellationToken cancellationToken)
       at Emby.Server.Implementations.HttpServer.HttpListenerHost.RequestHandler(IRequest httpReq, ReadOnlyMemory`1 urlString, ReadOnlyMemory`1 localPath, CancellationToken cancellationToken)
    Source: MediaBrowser.Controller
    TargetSite: Boolean IsAuthorizedToDelete(MediaBrowser.Controller.Entities.User, MediaBrowser.Controller.Entities.Folder[])
    
2022-02-21 14:08:23.810 Info Server: http/1.1 Response 500 to 192.168.178.71. Time: 3ms. http://192.168.178.23:8096/Items/178447
 

 

Link to comment
Share on other sites

Glueckstiger

Ah, Object reference not set to an instance of an object means permissions error 

Stupid me! ;)

I used the api key from server dashboard. With /Users/AuthenticateByName now it works. Thanks!

  • 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...