ginjaninja 533 Posted July 8, 2019 Share Posted July 8, 2019 using 4.2.0.25 I am new to the api and just learning how to use with C# in unity, so doing some tests in the swagger test interface. I want to return a list of tv show Names (eg "Homeland","Stranger Things" etc) and Ids Qu1. Should i be using &IncludeItemTypes=tvshows or &IncludeItemTypes=series or &IsSeries=true or something else to return just the tv shows Qu2. is it normal for a given userid for browsers to take a long time (minutes) and crash when returning all tvshows? everything is fine if i limit the results eg imdb.tt762372, but when i try to return everything (with recursive=true) the browser falls over. Qu2b. Am i right in saying it is not possible to just return just 'Name' and 'Id' (to minimise json size and maximise speed)? you have to have all the base information. Qu3. is it expected that when i ask for IncludeItemTypes=series , recursive=false from my root userid id view Emby returns 2 non series objects ( the root media library objects..tv and music and playlists......the collectionfolder s) I was expecting emby to return no items as their are no type=series in the root of the user id view (tvshows only exist within the tv media library) and even if add ExcludeItemTypes=CollectionFolder the collection folders still show i think i must be misunderstanding something fundamental.. thank you Link to comment Share on other sites More sharing options...
PenkethBoy 2063 Posted July 8, 2019 Share Posted July 8, 2019 Hi i use powershell but you should be able to see how to do it below For Q1 try this $embyServerUrl + "/emby/users/" + $User.User.Id + "/items?Recursive=true&SortBy=SortName&SortOrder=Ascending&GroupItemsIntoCollections=False&IncludeItemTypes=Series" + "&api_key=" + $User.AccessToken GroupItemsIntoCollections=False - just ensures that any Series in collections(boxsets) are listed as normal "Series" This will give you a full list of ALL Series If you want a list by Library (assuming you have more than one TV library in Emby) add &ParentID=<id of Tv Library> into the line above For Qu2 - usually when you get something "wrong" it takes ages to return the json - Emby by default can return everything as a json file - not had by browser crash when doing this - although you can wait a few mins when you try this in swagger Each api call returns a "standard" set of item values (which varies by call) but you can add extra items via the fields= property in the api call to get extra ones - dont think you can reduce the standard items though. For q3 - yes thats similar to getting something wrong - some api calls return something rather than nothing Note: to be clear a collectionType has nothing to do with collections (boxsets) as a CollectionType of "tvshows" is how the tv library can be picked form a list of libraries returned from Emby That should get you going - i guess you will have other questions Link to comment Share on other sites More sharing options...
ginjaninja 533 Posted July 8, 2019 Author Share Posted July 8, 2019 Hi i use powershell but you should be able to see how to do it below For Q1 try this $embyServerUrl + "/emby/users/" + $User.User.Id + "/items?Recursive=true&SortBy=SortName&SortOrder=Ascending&GroupItemsIntoCollections=False&IncludeItemTypes=Series" + "&api_key=" + $User.AccessToken GroupItemsIntoCollections=False - just ensures that any Series in collections(boxsets) are listed as normal "Series" This will give you a full list of ALL Series If you want a list by Library (assuming you have more than one TV library in Emby) add &ParentID=<id of Tv Library> into the line above For Qu2 - usually when you get something "wrong" it takes ages to return the json - Emby by default can return everything as a json file - not had by browser crash when doing this - although you can wait a few mins when you try this in swagger Each api call returns a "standard" set of item values (which varies by call) but you can add extra items via the fields= property in the api call to get extra ones - dont think you can reduce the standard items though. For q3 - yes thats similar to getting something wrong - some api calls return something rather than nothing Note: to be clear a collectionType has nothing to do with collections (boxsets) as a CollectionType of "tvshows" is how the tv library can be picked form a list of libraries returned from Emby That should get you going - i guess you will have other questions Thanks for confirmation on 'Series' and other pointers, i did a fresh build of the database and everything started working fine. 799 shows returned in <1second, previously it was timing out...weird Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now