Jump to content

Parental Controls Not Sending Notifications


jurmb84

Recommended Posts

jurmb84

** MOVED HERE FROM ANOTHER THREAD **

 

@Luke

 

I have a user account (Kids) in Emby that is Parental Controlled at TV-PG.

 

Mr. Robot is a TV Show (Excellent TV show btw) that is rated NA

Zoo is a TV Show that is rated N/A

 

Both of those show up in the Kids and should probably be treated as Not Rated which I have blocked on their acct... That is issue #1... 

 

However, when I go in and give them a Custom Rating of TV-MA, it only updates the users that have access to that level of rating but does not send a notification to any user that does not to have it removed from their external lists... i.e. it stays in Kodi and does not report on Emby.Kodi.SyncQueue... The only way I can get it out of Kodi is to go into "Launch" on the addon and do a "perform manual sync"...  That is issue #2...

 

Please advise... I don't know if I am missing something obvious that would make it send said notification...

  • Like 2
Link to comment
Share on other sites

well the series date modified will changed, but the content isn't deleted, only hidden from a user. therefore the library deleted events don't fire. this is tricky because there's multiple administrative features that could result in content being hidden, and the only sure fire way to get a complete content list is simply to query it again.

 

So right now there isn't really a built-in way for you to  handle this. what you could possibly do is get the full list of users, then call item.IsVisibleStandalone(user) - where item is an item that has been fired with library changed. that method returns a bool telling you if the item is visible to the user. So what you could do is call that for every user that has been used from the kodi client, record the bools and then include that with the data you send down to the client.

 

Or you could just query again.

  • Like 1
Link to comment
Share on other sites

jurmb84

@@Luke I would assume that that is what the "perform manual sync" does is a re-query...

 

@ what is your thought about doing an isVisible query before playing a file... The reason I ask is that even after I set it above the parental control max, the Kids user is able to play the item until I perform the manual sync and it removes it from the list... Just thinking about having to manually sync all of the computers that have kodi on it before a wandering child hits play... :o:blink:

Link to comment
Share on other sites

That would be great, but we don't currently have that level of auditing to be able to tell you specifically what fields changed. So I'm trying to come up with something realistic in the short term.

 

The other thing he could do is just query the library periodically from within the plugin. Since the code is running in-process it will be fast. Of course, in order to do that, you need something to compare it to in order to know that it changed. So you might have to do something like take snapshots server-side with lists of id's, and take action when those lists change.

  • Like 1
Link to comment
Share on other sites

Angelblue05

It is something we'll have to carefully consider how to approach the situation. It's like the boxset situation. There is no way to remove items from boxsets without doing a resync of the library. The server doesn't give this info via websocket and there's no way to query it and know the item is or isn't contained in a boxset.

  • Like 1
Link to comment
Share on other sites

Angelblue05

It verifies the parental access schedule. There's no verification of the rating before playback because it's already handled by the server with user rating and only importing what the user has access to. However if it's already added before the rating could be modified*, there's really nothing in place to handle this situation.

Edited by Angelblue05
  • Like 1
Link to comment
Share on other sites

Doing it before playback comes secondary to getting it out of the library. I think you should find a more general way to handle it with the data that your plugin reports back to the client. that is step 1. then after that, if you still want to do a check before playback, then you could consider that a bonus to improve the situation between syncs. But it's not a substitute.

 

I am currently tied up with all kinds of stuff for live tv, as well as that other big thing you are aware of in the dev forum. but eventually i can look at improving change reporting to make client-side caching easier. but i can't take that on right so we just have to find the best interim solution.

  • Like 1
Link to comment
Share on other sites

jurmb84

I understand what you are saying @@Luke

 

However, the plugin tracks for incremental sync based on a date and time of last sync... So if the user is logged in when that takes place then they are going to be past the date and time of when the MPAA rating was changed....

 

I agree that we should be able to come up with a graceful solution to this other than just not allowing it to play... But I may need a bit of guidance as to how to track the MPAA rating changes so I can report them as either a remove/add if they have access or just remove if they don't...

Link to comment
Share on other sites

Angelblue05

@@jurmb84

 

What you could do for now is block items with Rating NA etc so this way it won't get added to your kids library automatically before you have a chance to change the rating.

Link to comment
Share on other sites

jurmb84

So just a thought... Should I just add a scheduled task to track the item access for each item for each user and then report changes in both the incremental sync and the session sockets when I see something that was "visible" before but isn't now but is also not listed in the removedItems table...

Link to comment
Share on other sites

jurmb84

@@Angelblue05 I don't see a place to block individual rating types... Just a Maximum Allowed Rating which is currently set to PG/TV-PG

 

I would have thought that NA and N/A would be treated the same as no rating... I do see Block content with tags... but I don't have them tagged so I don't think that that would help...

Link to comment
Share on other sites

I understand what you are saying @@Luke

 

However, the plugin tracks for incremental sync based on a date and time of last sync... So if the user is logged in when that takes place then they are going to be past the date and time of when the MPAA rating was changed....

 

I agree that we should be able to come up with a graceful solution to this other than just not allowing it to play... But I may need a bit of guidance as to how to track the MPAA rating changes so I can report them as either a remove/add if they have access or just remove if they don't...

 

Forget the ratings. Don't think of it as rating changes but instead lists of item id's that belong in a user's library. You can get this information on the server pretty easily, so if you have something to compare it to, then you can determine that an Id is no longer present under a given parent node. That's going to cover parental ratings, removing items from collections, and any other administrative feature that could have a similar effect.

  • Like 1
Link to comment
Share on other sites

jurmb84

That might just actually work...

 

  1. Pull the user's items and store them...
  2. every x hours pull the items and compare
  3. if not removed but not visible add to removeItemsQueue table and send to user's sessions for those that are logged in...
  4. If not in original items but now have access add to ItemsAddedQueue table and send to user's session for those that are logged in...
  5. repeat every x hours to continually track administrative blocks...

Is there a way to ignore the scheduled watch times so we aren't accidentally removing things that shouldn't be removed??

Link to comment
Share on other sites

Angelblue05

@@Angelblue05 I don't see a place to block individual rating types... Just a Maximum Allowed Rating which is currently set to PG/TV-PG

 

I would have thought that NA and N/A would be treated the same as no rating... I do see Block content with tags... but I don't have them tagged so I don't think that that would help...

55d3f7e5c74ad_rating.png

 

That's what I was referring to. However if NA is not treated the same as No rating then nevermind.... :)

Edited by Angelblue05
Link to comment
Share on other sites

jurmb84

@@Angelblue05 I am already doing that...

 

It doesn't stop NA and N/A... A friend of mine is who brought this to my attention and then I did some testing and found it to be correct... That setting only blocks if the rating is truely blank...

Edited by jurmb84
  • Like 1
Link to comment
Share on other sites

N/A is invalid and this should be caught by whatever code is importing it.

 

I don't know what you mean by ignore scheduled watch times, but if you're going to do it every certain number of hours then you can create a scheduled task that will appear in the web interface.

Link to comment
Share on other sites

Angelblue05

It just seems to me, and I remember reading a FR about this.... All of this could be resolved if the server admin had the possibility of reviewing the item before it getting added to the library, by being able to block specific rating - the same way block tags work. It's easier to add then to remove.... 

 

The issue comes down to having an item being available to users because the rating was NA. Keeping track of everything per user seems very intense. Agreed null_pointer.**

Edited by Angelblue05
  • Like 2
Link to comment
Share on other sites

jurmb84

@ @@Angelblue05 I agree that there might be some overhead... But as a system admin I wouldn't mind being able to hide something administratively and then manually run a scheduled task (if i don't want to wait) to have it remove or setup to remove via sync to get it out of kodi...

 

Ultimately, I agree that the ability to block specific ratings would be most helpful.  However, that won't stop a show coming in with some weird rating that might make it to the end user that would then need to have something in place to allow it to be removed...

 

@@Luke 1.) I am using standard Emby metadata scraping to pick up information on new shows... I have no clue why they came in with NA and N/A... 2.) I think I might do a seperate plug in for this as a POC first and then monitor the amount of resouces it consumes... I have a very large library so I should get some reasonable timings... I will post my findings to the group and if we agree that it is non-obtrusive then it can be added into the SyncQueue project and released as a beta for further testing...

 

Do you have any specific places I can look for code examples for the following 2 items...

 

1.  Getting all items in the individual users view... (what they have access to...)

2.  Scheduled Tasks Interface

 

I have a couple of other projects for work that are consuming the majority of my time for the next few days but might be able to make some headway this weekend...

 

Thanx in advance... 

Link to comment
Share on other sites

N/A is invalid and this should be caught by whatever code is importing it.

 

I don't know what you mean by ignore scheduled watch times, but if you're going to do it every certain number of hours then you can create a scheduled task that will appear in the web interface.

 

Yeah, I recently ran into this as well.  One of our providers is providing several new, unknown ratings.

 

Any rating that doesn't resolve into the list we have should get treated as if it were no-rating.  That's just something we need to handle at the rating validation stage.  Luke, do you want me to look at that?

  • Like 1
Link to comment
Share on other sites

jurmb84

Understand that it is not just NA or N/A that is an issue for me... There are many shows that have a rating of TV-PG that I do not need my 9 year old watching... i.e. Grace and Frankie, Necessary Roughness or The Whispers to name a few...

Those shows will ultimately make it to their library so I can still see a need for something to get them out of there without having to manually sync every kodi in the house... (or every kodi that is remote that I don't have access to)...

 

Also, by the sound of things, this issues also exists for BoxSet syncing with kodi... (although I may need a bit more information from @@xnappo @ and @@Angelblue05 to make sure I handle those correctly)...

 

So I can see the necessity for something to "help" manage these types of issues... Not to mention it sounds like a fun project...  :P

  • Like 2
Link to comment
Share on other sites

defiance77

It just seems to me, and I remember reading a FR about this.... All of this could be resolved if the server admin had the possibility of reviewing the item before it getting added to the library, by being able to block specific rating - the same way block tags work. It's easier to add then to remove.... 

 

The issue comes down to having an item being available to users because the rating was NA. Keeping track of everything per user seems very intense. Agreed null_pointer.**

 

I previously made a FR in this area with solving the same basic problem in mind.

 

My request was for reversing the block tag function to only allow content that have a specific tag added. That way I would be sure that newly added content would never be availiable to my kid without me explicitly allowing it. The same logic could be applied to ratings, to only allow content that have the selected ratings.

 

http://emby.media/community/index.php?/topic/21296-server-parental-control-block-content-without-tag-or-autotag-new-additions-feature/

Edited by defiance77
  • Like 2
Link to comment
Share on other sites

Understand that it is not just NA or N/A that is an issue for me... There are many shows that have a rating of TV-PG that I do not need my 9 year old watching...

 

Yes, there are two separate issues here (the unknown ratings and the fact that rating information has changed).  I was just addressing the first issue which is properly handling a rating that isn't in our list of known ones.

  • Like 1
Link to comment
Share on other sites

jurmb84

I just thought of something... There is always a master user that has no blocking at all... When an item gets updated that user will always receive an update... I should be able to insert code in the update section that goes through the users and push a remove item signal for any user that does not have access to that item... 

 

@@xnappo @@Angelblue05 or @ will it cause an issue if I send you items to remove that are not currently in Kodi?  If not I think I just found a very easy way to do this without causing much overhead at all... Item adds and removes would stay the same as they are global to all users...

Edited by jurmb84
Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...