Jump to content

Recommended Posts

Posted

I have no idea how to do this  LOL...

Which service endpoint is responsible for chapter data? 

I thought it was, 'Item' but...

 

😃 

Posted

Hi, just pull down the item you want and there will be a .Chapters property.

  • Like 1
Posted

chapters.thumb.png.3096ad154c86880a3f3b7644246ae54c.png

Sorry, quick follow up.

I should see them as part  of the Entities.BaseItem

rbjtech
Posted (edited)

I can query them via the API ?

curl -X GET "http://***:8096/emby/Items?Fields=Chapters&Ids=440729&api_key=***" -H "accept: application/json"

QueryResult_BaseItemDto{

Items[BaseItemDto{...}]

TotalRecordCountinteger($int32)

}

Output -

 

{
  "Items": [
    {
      "Name": "Spartacus",
      "ServerId": "e9f679de4d284ca2bf07eb4e72a19ea7",
      "Id": "440729",
      "RunTimeTicks": 118038180000,
      "IsFolder": false,
      "Type": "Movie",
      "ImageTags": {
        "Primary": "8142d00c86f41cfa35c4e3576a507359",
        "Logo": "3ee63bb9bdf748e7b47632c3d7b3bdb1",
        "Thumb": "33c6391c68abb9fe673a5aefb3052831"
      },
      "BackdropImageTags": [
        "95a5992d37af26fda7fe16a3359dab98",
        "23494a9c7ae96dfea94460d238bd3021"
      ],
      "Chapters": [
        {
          "StartPositionTicks": 0,
          "Name": "Overture",
          "ImageTag": "fd1ef87c51224ed35e7fdc63dbe9ccc1"
        },
        {
          "StartPositionTicks": 2433680000,
          "Name": "Main Titles",
          "ImageTag": "fd1ef87c51224ed35e7fdc63dbe9ccc1"
        },
        {
          "StartPositionTicks": 4645470000,
          "Name": "A Disease Called Human Slavery",
          "ImageTag": "fd1ef87c51224ed35e7fdc63dbe9ccc1"

.....
        },
Edited by rbjtech
  • Agree 1
Posted (edited)

Ah, BaseItemDto, that is different from the BaseItem object. 

I'll check it out now.

Cool! 

EDIT: Yep, that's it. Thank you :)

Chapters2.png.45de8cb7ea42a44191fca1300918a517.png

Edited by chef
Posted (edited)

Here is a new question about Chapters...

When you want to link to a primary image from the server, the url looks like this:

$"/Items/{item.InternalId}/Images/primary?quality=90&maxHeight=1008&maxWidth=700";

 

Chapters seem to have an "ImagePaths" property, which I would assume is the physical directory of the image... I think...

It also has a "ImageTag" property... 

What does the URL look like for requesting the chapter image? Can you link an image in a URL using Tags?

If not, am I suppose to wrap my own Service Endpoint to handle the "ImagePath" for the chapter? 😬

Edited by chef
Posted

Have you checked out the urls used by the web app?

  • Agree 1
Posted (edited)

Perfect! getting Chapters is:

$"/Items/{item.Id}/Images/Chapter/{index}?maxWidth=637";

 

What is the best way to get the Dto version of a baseItem?

LibraryManager will give me the BaseItem. 

Perhaps I need to request the data based on a User?

 

Edited by chef
Posted

Looks like you can use the "IDtoService" to convert the object... maybe....

Posted

You can, but you can probably also just use the original server objects this is just server side code.

Posted
29 minutes ago, Luke said:

You can, but you can probably also just use the original server objects this is just server side code.

Although there are some properties in BaseItemDto that are not in BaseItem. Chapters for instance. 

 

Posted (edited)

It's not pretty yet, but I got chapters working!

 

 

Edited by chef
  • Like 3

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