Jump to content

Changing IsPlayed through HTTP API?


morpheus65535

Recommended Posts

morpheus65535

Is there a way to change the boolean value of Items->UserData->IsPlayed through HTTP API?

 

By the way, is it possible to remove an item from library through the same API?

 

Thank you very much guys for your help!

Link to comment
Share on other sites

morpheus65535

Yes.  POST/DELETE to users/{userId}/PlayedItems/{itemId}

 

Thanks @@ebr, I'll give it a try. And for the second question, can I remove an item from the library (like I use to do in Kodi) or is it pointless? Is the item automatically removed form library if deleted from disk?

 

Thank you (again) ! :-)

Link to comment
Share on other sites

Yes, we maintain the library automatically so it will be removed once it is gone from the system.  Exactly when depends on environment and settings but, at the very latest, with the next library scan.

Link to comment
Share on other sites

morpheus65535

Yes, we maintain the library automatically so it will be removed once it is gone from the system.  Exactly when depends on environment and settings but, at the very latest, with the next library scan.

 

Nice! I'm realy grateful you took the time to help me on this. Nice works on Emby by the way, you've made it a really nice piece of software! :-)

Link to comment
Share on other sites

  • 2 weeks later...
morpheus65535

Yes.  POST/DELETE to users/{userId}/PlayedItems/{itemId}

 I finally got time to test it but it doesn't seems to work. You got an idea what I'm doing wrong? Thanks!

2016-04-04 21:07:29.0986 Info HttpServer: HTTP POST http://127.0.0.1:8096/emby/Users/53b5e750d18c4b82a2e6d78103354831/PlayedItems/3e5bfad4e9910c0af7728683a61e0b5b. UserAgent: 
2016-04-04 21:07:29.1034 Error DtoUtils: ServiceBase<TRequest>::Service Exception
	*** Error Report ***
	Version: 3.0.5912.0
	Command line: /usr/lib/emby-server/bin/MediaBrowser.Server.Mono.exe -programdata /var/lib/emby-server -restartpath /usr/lib/emby-server/restart.sh
	Operating system: Unix 3.19.0.56
	Processor count: 2
	64-Bit OS: True
	64-Bit Process: True
	Program data path: /var/lib/emby-server
	Mono: 4.2.1 (Stable 4.2.1.102/6dd2d0d Thu Dec  3 04:04:55 UTC 2015)
	Application Path: /usr/lib/emby-server/bin/MediaBrowser.Server.Mono.exe
	Value cannot be null.
	Parameter name: appVersion
	System.ArgumentNullException
	  at MediaBrowser.Server.Implementations.Session.SessionManager+<LogSessionActivity>c__async1.MoveNext () <0x413b0530 + 0x0015f> in <filename unknown>:0 
	--- End of stack trace from previous location where exception was thrown ---
	  at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () <0x7f27982d76d0 + 0x00029> in <filename unknown>:0 
	  at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) <0x7f27982d56b0 + 0x000a7> in <filename unknown>:0 
	  at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) <0x7f27982d5630 + 0x0006b> in <filename unknown>:0 
	  at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) <0x7f27982d55e0 + 0x0003a> in <filename unknown>:0 
	  at System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1+ConfiguredTaskAwaiter[TResult].GetResult () <0x7f27982d5d10 + 0x00017> in <filename unknown>:0 
	  at MediaBrowser.Api.BaseApiService+<GetSession>c__async0.MoveNext () <0x413bda20 + 0x00185> in <filename unknown>:0 
	--- End of stack trace from previous location where exception was thrown ---
	  at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () <0x7f27982d76d0 + 0x00029> in <filename unknown>:0 
	  at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) <0x7f27982d56b0 + 0x000a7> in <filename unknown>:0 
	  at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) <0x7f27982d5630 + 0x0006b> in <filename unknown>:0 
	  at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) <0x7f27982d55e0 + 0x0003a> in <filename unknown>:0 
	  at System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1+ConfiguredTaskAwaiter[TResult].GetResult () <0x7f27982d5d10 + 0x00017> in <filename unknown>:0 
	  at MediaBrowser.Api.UserLibrary.PlaystateService+<MarkPlayed>c__async0.MoveNext () <0x414fffc0 + 0x00384> in <filename unknown>:0 
	
2016-04-04 21:07:29.1034 Error HttpServer: Error processing request for /emby/Users/53b5e750d18c4b82a2e6d78103354831/PlayedItems/3e5bfad4e9910c0af7728683a61e0b5b
	*** Error Report ***
	Version: 3.0.5912.0
	Command line: /usr/lib/emby-server/bin/MediaBrowser.Server.Mono.exe -programdata /var/lib/emby-server -restartpath /usr/lib/emby-server/restart.sh
	Operating system: Unix 3.19.0.56
	Processor count: 2
	64-Bit OS: True
	64-Bit Process: True
	Program data path: /var/lib/emby-server
	Mono: 4.2.1 (Stable 4.2.1.102/6dd2d0d Thu Dec  3 04:04:55 UTC 2015)
	Application Path: /usr/lib/emby-server/bin/MediaBrowser.Server.Mono.exe
	Value cannot be null.
	Parameter name: appVersion
	ServiceStack.HttpError
	No Stack Trace Available
	
2016-04-04 21:07:29.1109 Info HttpServer: HTTP Response 400 to 127.0.0.1. Time: 13ms. http://127.0.0.1:8096/emby/Users/53b5e750d18c4b82a2e6d78103354831/PlayedItems/3e5bfad4e9910c0af7728683a61e0b5b
Link to comment
Share on other sites

morpheus65535

This is my curl options for my PHP request:

curl_setopt($ch, CURLOPT_URL, "http://127.0.0.1:8096/emby/Users/53b5e750d18c4b82a2e6d78103354831/PlayedItems/3e5bfad4e9910c0af7728683a61e0b5b");
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
  'X-MediaBrowser-Token: <apikey>',
  'Content-Type, application/json',
  'Content-Length: 0'
  ));

It works well if I try do to a refresh on an item. I don't understand

Edited by morpheus65535
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...