ginjaninja 537 Posted January 15, 2023 Share Posted January 15, 2023 I am finding seriespeople = LibraryManager.GetItemPeople(baseitem); does not yield .Id on the members of the list (they are all 0) but var seriesquery = new InternalPeopleQuery { ItemIds = new[] { item.InternalId }, EnableIds = true, }; seriespeople = LibraryManager.GetItemPeople(seriesquery); does yield .Id on the members of the list is that intentional? as a point of learning is there a structure in namespace MediaBrowser.Controller.Library that should clue me into this (i am new to c#) thanks for any advice. Link to comment Share on other sites More sharing options...
mickle026 401 Posted January 16, 2023 Share Posted January 16, 2023 I'll explain how I do it, it can probably be done easier, but this works. Not sure but when you do the 1st query you get an Array of PersonTypes which have to be re-read an the InternalId is inside each element var People = libraryManager.GetInternalItemIds(new InternalItemsQuery { IncludeItemTypes = new[] { "Person" } }); foreach (var xPerson in People) { var ActorInfo = libraryManager.GetItemById(xPerson); var ActorInternalId = ActorInfo.Id; } So var seriespeople = LibraryManager.GetItemPeople(baseitem); Returns an Array so the for loop below for the example above would iterate over each entry and pull out th Internal Id's foreach (var xPerson in SeriesPeople) { var ActorInfo = libraryManager.GetItemById(xPerson); var ActorInternalId = ActorInfo.Id; } If you want series people only this example would get the all Series in the library first then get the people in each series only, then process whatever you wanted to do var xSeries = libraryManager.GetInternalItemIds(new InternalItemsQuery { IncludeItemTypes = new[] { "Series", "Episode" } }); foreach (var eachShow in xSeries) { var Actorlist = libraryManager.GetInternalItemIds(new InternalItemsQuery { AppearsInItemIds = new[] { eachShow } }); foreach (var xPerson in Actorlist) { var ActorName = libraryManager.GetItemById(xPerson).Name; var ActorID = libraryManager.GetItemById(xPerson); var ImagePath = ActorID.PrimaryImagePath; // more code } } So the above will get all series and Episodes (because episodes often contain extra people than the series level only) Then for each series (one by one) get the cast (people) The you get the items you need. Here ActorID provides all the info Type ActorID then after you type the dot "." - the options will show in visual studio editor popup All you have to remember is that you have an array of Person Types, so each Person type you have to query library manager again for the Id. So for each PersonType in the SeriesPeople, iterate and get each PersonInfo Id, then get the InternalId. foreach (var xPerson in SeriesPeople) { var ActorInfo = libraryManager.GetItemById(xPerson); var ActorInternalId = ActorInfo.Id; } I would query the actual series and Episode of the BaseItem rather than the people, then query the people of that otherwise you probably wont get all the people that are in episode level but only those shown at series level as Series and Episodes are treated differently. I hope there is something here that helps and doesn't confuse ...... 2 Link to comment Share on other sites More sharing options...
Cheesegeezer 3087 Posted January 16, 2023 Share Posted January 16, 2023 This sounds like a short coming (bug) in the query to get the PersonInfo. Surely the Id should be populated, all other fields are populated in class. Link to comment Share on other sites More sharing options...
ginjaninja 537 Posted January 16, 2023 Author Share Posted January 16, 2023 (edited) 1 hour ago, Cheesegeezer said: This sounds like a short coming (bug) in the query to get the PersonInfo. Surely the Id should be populated, all other fields are populated in class. On my 3rd day of c# it probably a bit rich for me to call "bug" (Even if i have had an excellent mentor ;-)); but its seems odd to me too. These are the package versions im using. Edited January 16, 2023 by ginjaninja Link to comment Share on other sites More sharing options...
Cheesegeezer 3087 Posted January 16, 2023 Share Posted January 16, 2023 I have also noticed that the other fields are not populated. The below is output to the log and using the PersonInfo Class Which has the following properties available. Guy Bee with RoleType: Director & Id = 0 & ItemId = 431 ImageUrl = Guid = 00000000-0000-0000-0000-000000000000 @mickle026 has shown some great work arounds but there is alot of double handling and i know you have done amazing with your Anime Persons plugin so thanks so much for your help with this. 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