Jump to content

How to set the PlaybackPositionTicks field for an Item


HawkXP71

Recommended Posts

HawkXP71

using the "Users/<userID>/PlayedItems/<itemID> API call I can set if an episode/movie has been played. 

However, I cant find how to set at that position it was last played to.

Is this possible?

Link to comment
Share on other sites

HawkXP71

The other user data on the item I would like to modify is PlayCount and LastPlayedDate  as well

Edited by HawkXP71
Link to comment
Share on other sites

HawkXP71
11 hours ago, Luke said:

Hi, where are you looking for the api methods?

Do you have any thoughts on being able to set the Tick Position Count, and setting the LastPlayDate?

Link to comment
Share on other sites

HawkXP71
On 7/12/2022 at 8:22 AM, HawkXP71 said:

Do you have any thoughts on being able to set the Tick Position Count, and setting the LastPlayDate?

Could you be a bit more specific.  In general I have :) however, there are 5 major services with User in their name, the only one that seems to apply is the UserLibraryServer

However, in the swagger, I only see how to set/unset if its a Favorite and the rating.

In the Playstate Service, I can toggle the played state via /Users/{UserId}/PlayedItems/{Id} 

/Users/{UserId}/PlayingItems/{Id}/Progress doesnt seem to set the progress, only read it.

And any change, setting the favorite or played, changes the LastPlayDate

 

 

Link to comment
Share on other sites

HawkXP71
5 minutes ago, Luke said:

What other methods do you see in the PlaystateService?

POST/Users/{UserId}/PlayedItems/{Id}
Marks an item as played
DELETE/Users/{UserId}/PlayedItems/{Id}
Marks an item as unplayed
POST/Users/{UserId}/PlayingItems/{Id}
Reports that a user has begun playing an item
DELETE/Users/{UserId}/PlayingItems/{Id}
Reports that a user has stopped playing an item
POST/Users/{UserId}/PlayingItems/{Id}/Progress
Reports a user's playback progress
Link to comment
Share on other sites

HawkXP71

Using the "Progress" api
http://mediabox:8096/Users/<userID>/PlayingItems/<mediaid>/Progress?api_key=<apikey>

and the follwoing in the data for the post

{
    "PositionTicks": "10"
}

Here are the results from the log, it "reports" back where it currently is, however, not in the data sent back from the server.  I have no read where its reporting it
 

2022-07-13 12:25:38.980 Info Server: http/1.1 POST http://host2:8096/Users/823e15cd455744859ec898feb27bd4f0/PlayingItems/222955/Progress. UserAgent: Mozilla/5.0
2022-07-13 12:25:39.027 Info Server: http/1.1 Response 204 to host3. Time: 47ms. http://host2:8096/Users/823e15cd455744859ec898feb27bd4f0/PlayingItems/222955/Progress
2022-07-13 12:25:57.769 Info PlaybackReporting - EventMonitorEntryPoint: Adding PlaybackInfo to playback_trackers : be875b9574774ca58c487f1a290dff83--222955
2022-07-13 12:25:57.769 Info PlaybackReporting - EventMonitorEntryPoint: Saving PlaybackInfo to DB
Link to comment
Share on other sites

OK I guess that static view is a little out of date, but this is what you want:

POST /Users/{UserId}/Items/{ItemId}/UserData

You can update the whole userdata object that way.

Link to comment
Share on other sites

HawkXP71
2 hours ago, Luke said:

OK I guess that static view is a little out of date, but this is what you want:

POST /Users/{UserId}/Items/{ItemId}/UserData

You can update the whole userdata object that way.

THANKS!  Is there anyway to get truely "live" api calls? (even if you point me to the git location for the source)

Also, do you have an example? I assume the UserData is posted data, not parameters?

Link to comment
Share on other sites

You'd have to use the non-static view of swagger by clicking the api link at the bottom of your server dashboard.

  • Thanks 1
Link to comment
Share on other sites

HawkXP71
4 hours ago, Luke said:

You'd have to use the non-static view of swagger by clicking the api link at the bottom of your server dashboard.

Im on a synology box, that means my emby connection is not secure (http not https) however now the live api reports an error in this.  is there a way around this issue? 

Link to comment
Share on other sites

HawkXP71
48 minutes ago, Luke said:

You'd have to be either on https or localhost.

I was afraid of that.

However, I was able to just look at the API reported and searched and was able to learn enough.  The request body is a UserItemDataDto

Im sending the following json

{
    "IsFavorite": false,
    "LastPlayedDate": "2022-07-15T21:35:13.000Z",
    "PlayCount": 10,
    "PlaybackPositionTicks": 366,
    "Played": true
}

The IsFavorite isnt changing to "false" on the system, I request the item from the server, and there is no change.

 

 

 

 

Link to comment
Share on other sites

OK yes looks like it's currently not checking IsFavorite, so for now I would use the dedicated endpoint for that.

  • Like 1
Link to comment
Share on other sites

HawkXP71

It does work

14 minutes ago, HawkXP71 said:

I was afraid of that.

However, I was able to just look at the API reported and searched and was able to learn enough.  The request body is a UserItemDataDto

Im sending the following json

{
    "IsFavorite": false,
    "LastPlayedDate": "2022-07-15T21:35:13.000Z",
    "PlayCount": 10,
    "PlaybackPositionTicks": 366,
    "Played": true
}

The IsFavorite isnt changing to "false" on the system, I request the item from the server, and there is no change.

 

 

 

 

It does work using the Users/{userid}/FavoriteItems/{itemId} post/delete API

Link to comment
Share on other sites

HawkXP71
On 7/15/2022 at 4:18 PM, Luke said:

OK yes looks like it's currently not checking IsFavorite, so for now I would use the dedicated endpoint for that.

Should I file a bug on this? If so, how?

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