Cheesegeezer 3089 Posted January 25, 2023 Share Posted January 25, 2023 (edited) Using c# and getting libraryItems via InternalItemQuery. is there a string to filter on ExcludeItemTypes or is there another property i need to use. or should the user be setting this content to x rated or something? thanks in advance Edited January 26, 2023 by Cheesegeezer Link to comment Share on other sites More sharing options...
Happy2Play 8340 Posted January 25, 2023 Share Posted January 25, 2023 Don't think there is beside MaxOfficialRating assuming the items have a rating. As they are "Type": "Movie", , "MediaType": "Video" 1 Link to comment Share on other sites More sharing options...
Cheesegeezer 3089 Posted January 26, 2023 Author Share Posted January 26, 2023 (edited) 21 hours ago, Happy2Play said: Don't think there is beside MaxOfficialRating assuming the items have a rating. As they are "Type": "Movie", , "MediaType": "Video" Sorry Happy missed this one. Yup i ended up setting the UserMaxRating if null to RatingValue of 9 as any XRated items have a score of 10 and it seems to be working. but it's up to the end user to ensure this content has the max Parental rating set. Seems to work nicely // Set User Max Rating to 9 if no limit has been set (this will eliminate any Xrated content which is at the max setting of 10) var userMaxRating = user.Policy.MaxParentalRating != null ? user.Policy.MaxParentalRating.Value : 9; Log.Info("User.Name retrieved: {0}", user.Name); Log.Info("User.ParentalRating: {0}", userMaxRating.ToString()); List<BaseItem> wItems = new List<BaseItem>(); QueryResult<BaseItem> libraryResult = LibraryManager.GetItemsResult(new InternalItemsQuery(user) { Recursive = true, MaxParentalRating = userMaxRating, MediaTypes = new[] {"Video"}, ExcludeTags = new []{"top-pick"}, IncludeItemTypes = new[] {nameof(Movie), nameof(Episode) }, ExcludeItemTypes = new[] {nameof(Trailer), nameof(BoxSet) }, DtoOptions = new DtoOptions(true), }); Edited January 26, 2023 by Cheesegeezer Link to comment Share on other sites More sharing options...
Luke 37191 Posted January 26, 2023 Share Posted January 26, 2023 Official answer - have the user configure the libraries that whatever this feature is will apply to. Then they can exclude adult content or anything else they wish. 1 Link to comment Share on other sites More sharing options...
Cheesegeezer 3089 Posted January 26, 2023 Author Share Posted January 26, 2023 1 minute ago, Luke said: Official answer - have the user configure the libraries that whatever this feature is will apply to. Then they can exclude adult content or anything else they wish. It's a channel and i'm trying to avoid any config for this. I don't think it's necessary. But i think if the User sets their Allowed Parental Rating to the Max Value this will let them view what they want and restrict the other users. Link to comment Share on other sites More sharing options...
Cheesegeezer 3089 Posted January 26, 2023 Author Share Posted January 26, 2023 @Luke @softworkz I'm not sure if this is a bug in channels, however i've set up a kidsTest user which has the following settings applied to the profile It filters any content in the other users channels except the unrated or unrecognised for example When i view the channel (Profile set to GB-R18 (value=10) and don't have any options ticked for block unrated content, i can see this in my user channel, i've set some of these manually to unrated, value 8,9 & 10's so everything shows correctly But in when i switch to the kidsTest User profile it still shows the unrated items in my channel and i can play them - scary stuff Running Beta 4.8.21 on Win 10 Logs don't show anything. However normal library content it work for the kids profile. Just wondering if there is something not wired up for the channels. Link to comment Share on other sites More sharing options...
Luke 37191 Posted January 26, 2023 Share Posted January 26, 2023 Do the channel items have parental ratings set? Link to comment Share on other sites More sharing options...
Cheesegeezer 3089 Posted January 26, 2023 Author Share Posted January 26, 2023 (edited) 4 hours ago, Luke said: Do the channel items have parental ratings set? Yes, well some of them do, except house episodes and emby dev episode. they are baseItems from Emby. You can see here from the log... 2023-01-26 06:57:05.434 Info Watch History: User ChannelName: Watch History for KidsTest 2023-01-26 06:57:05.434 Info Watch History: We are a match for chItem.Id=24 against chQuery.FolderId = 24 2023-01-26 06:57:05.434 Info Watch History: User.Name retrieved: KidsTest 2023-01-26 06:57:05.434 Info Watch History: User.ParentalRating: 5 2023-01-26 06:57:05.439 Debug Watch History: Total LibItems Found: 69 2023-01-26 06:57:05.439 Debug Watch History: Total Watched Items Found: 1 --- Max Limit Set By User = 100 2023-01-26 06:57:05.439 Debug Watch History: Reordered Item added = Despicable Me 2 ParentalRating: 1 2023-01-26 06:57:05.439 Info Watch History: User ChannelName: Watch History for DaveyB 2023-01-26 06:57:05.439 Info Watch History: We are a match for chItem.Id=1 against chQuery.FolderId = 1 2023-01-26 06:57:05.439 Info Watch History: User.Name retrieved: DaveyB 2023-01-26 06:57:05.439 Info Watch History: User.ParentalRating: 9 2023-01-26 06:57:05.449 Debug Watch History: Total LibItems Found: 119 2023-01-26 06:57:05.449 Debug Watch History: Total Watched Items Found: 11 --- Max Limit Set By User = 100 2023-01-26 06:57:05.449 Debug Watch History: Reordered Item added = Spider-Man: No Way Home ParentalRating: 7 2023-01-26 06:57:05.449 Debug Watch History: Reordered Item added = Emby SDK ParentalRating: 2023-01-26 06:57:05.449 Debug Watch History: Reordered Item added = The Matrix Resurrections (2021) ParentalRating: 9 2023-01-26 06:57:05.449 Debug Watch History: Reordered Item added = Top Gun: Maverick ParentalRating: 7 2023-01-26 06:57:05.449 Debug Watch History: Reordered Item added = Damned If You Do ParentalRating: 2023-01-26 06:57:05.449 Debug Watch History: Reordered Item added = The Socratic Method ParentalRating: 2023-01-26 06:57:05.449 Debug Watch History: Reordered Item added = Occam's Razor ParentalRating: 2023-01-26 06:57:05.449 Debug Watch History: Reordered Item added = Paternity ParentalRating: 2023-01-26 06:57:05.449 Debug Watch History: Reordered Item added = Ready Player One ParentalRating: 6 2023-01-26 06:57:05.449 Debug Watch History: Reordered Item added = Maternity ParentalRating: 8 2023-01-26 06:57:05.449 Debug Watch History: Reordered Item added = Pilot ParentalRating: Edited January 26, 2023 by Cheesegeezer Link to comment Share on other sites More sharing options...
Luke 37191 Posted February 21, 2023 Share Posted February 21, 2023 Quote But in when i switch to the kidsTest User profile it still shows the unrated items in my channel and i can play them Does the emby metadata editor show the correct parental rating for those items? 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