Jump to content

Get all episodes for a Show ordered


Recommended Posts

chessdragon136
Posted (edited)

Hi All,

 

I feel like an idiot today but no matter what I try I cannot get a list of all episodes belonging to a TV show ordered by Season and then by Episode number:

 

My URL is like the below:

 

http://SERVER/mediabrowser/Users/USER/Items?ParentId=0d002d51624deba459376823e70aace3&format=json&IncludeItemTypes=Episode&Recursive=true&SortBy=ParentIndexNumber,IndexNumber&SortOrder=Ascending&Fields=ParentId,SortName,MediaSources

 

The parent id is correct for a tv show and this does return all episodes, just not ordered (or ordered in any fashion i can see, starts with episode 7..)

 

What am i doing wrong? 

Edited by chessdragon136
Posted

Sort by SortName.  I think there is also maybe a better endpoint under 'Shows' but Swagger is hosed at the moment so I can't look it up.

Posted

Yeah, you can use Shows/{id}/Episodes and I bet those will return in the proper order and probably also respect the specials in the proper place while the generic endpoint probably won't do that.

chessdragon136
Posted

Of course it is - Just being dumb today, Thank you.

 

And yeah have seen it in Swagger but until its added as an exception to the authentication token its no use.

chessdragon136
Posted (edited)

Shows/ID/Episodes? i cant make work for me and again without swagger working i don't know why its not working.

 

Server.getCustomURL("/Shows/" + this.ItemData.Items[this.selectedItem].Id +  "/Episodes?format=json&Fields=ParentId,SortName,MediaSources");

Edited by chessdragon136
Posted

The dev server now has a place to enter an API key in swagger (yea).

  • Like 1
chessdragon136
Posted (edited)

I did not know that! That is amazing.  :D 

 

However, with Shows\ID\Episodes I now have:

 

54c79a72e12a4_Capture.png

 

 

which generates the URL (http removed to prevent link)

localhost:8096/Shows/{Id}/Episodes?UserId=4b4c128121aa642086bb225659a7d471&Id=0d002d51624deba459376823e70aace3&api_key=6bc5322a69c243df90f7a90532a7533b

 

Which generates a 422 response of:

{ "ResponseStatus": { "ErrorCode": "InvalidOperationException", "Message": "Nullable object must have a value.", "StackTrace": "[GetEpisodes: 27/01/2015 13:59:16]:\n[REQUEST: {UserId:4b4c128121aa642086bb225659a7d471,Id:0d002d51624deba459376823e70aace3}]\nSystem.InvalidOperationException: Nullable object must have a value.\r\n at System.ThrowHelper.ThrowInvalidOperationException(ExceptionResource resource)\r\n at MediaBrowser.Api.TvShowsService.Get(GetEpisodes request)\r\n at lambda_method(Closure , Object , Object )\r\n at ServiceStack.Host.ServiceRunner`1.Execute(IRequest request, Object instance, TRequest requestDto)", "Errors": [] } }

Edited by chessdragon136
Posted

Looks like a bug in the dev server.  Post it in the Alpha area please.

  • Like 1

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