Closed deathbybandaid closed 2 years ago
I think these ideas are good. Thanks for the suggestions.
I will definitely create a json file with common sense media data to store the data, but I would still like to update every once in a while as their website updates, but I can decrease the load as much as I can. At the very least I will store the verified matched URLs for each movie, so it doesn't have to re-search and verify the match each time it looks for it.
Currently, if a match isn't found, it stores the movie title in a json file, so it doesn't re-get all the same missing ones on the next run. But I have it set to re-run those old ones every 3 months in case the movie got added, I think I'll space that out further for older movies so it doesn't keep searching every 3 months forever. I am working on improving matches by checking against the IMDb code, but in some movies the IMDb code listed in common sense media doesn't match the IMDb code listed in plex because IMDB has 2 codes that were combined (ie. Encanto). So what I'm going to do for those is, if common sense media search (ie. search 'Encanto' in movies) only shows 1 result. Just use that. I have to do this for TV shows because commonsense doesn't store external IDs for shows, as far as I can tell.
I considered replacing the ratings with common sense media ratings as you suggested, but I decided against it because 1) I still like to see what the rating is and I cannot store two ratings for a movie. And 2) I want to be able to choose which movies are allowed for each kid and be able to change it. Sometimes I just want to temporarily unapproved a movie because my wife and I get sick of the kids watching it so often (like Frozen). I also like to give each kid a few movies that are only on their account because it gets them excited. (ie. I gave only my 7yo Detective Pikachu because he's a huge pokemon fan, and my 9yo got sonic and my 5yo really wanted boss baby, which is a 6+ movie). And sometimes my boys just don't want to scroll through all the princess, my little pony, and barbie movies when he is browsing. This level of control without replacing any metadata can only be done through labels. I have a label for each age, an (OPTIONAL in settings) label for age_gender, and a label for that kid's name. It gives me all the control i'd want. And lets me easily remove movies I don't want my kids to see for whatever reason even if it's a temporary removal.
I wouldn't know how to integrate with radarr/sonarr without some digging into the documentation, and I have to juggle medical school with growing kids, so I probably won't get to that. But any help would be appreciated.
I also have no experience with Emby/Jellyfin, but I have been considering migrating since I don't like the direction plex is headed, but I would want these functions before migrating if I ever do.
I wasn't suggesting replacing the content ratings, but putting the content ratings from CommonSense as labels, but with a CommonSense_
tag
Oh, I missed that. Right now it just stores them as 7+, but having CommonSense_ in front does seem better.
That way you keep a level of compatibility with possible other scripts.
I am writing for it to save some CommonSense information and prevent more than five requests per second from common sense media. It should only slow down the first run for a server, but it will prevent too many requests if someone with like 20+k movies decides to run the script
Generate a CommonSense.json file alongside media and/or in a sqlite database. This will reduce the load on CommonSense's website, and help with Plex Server reinstallation. If a match isn't certain or found for media, output a list of shows/movies and their paths to do manual intervention. Keep CommonSense Age ratings instead of using PG- and PG+. Then use the labeling to create labels like CS_3 or CommonSense_3+ to indicate content approved for ages 3+
I have done these things in version 1.0.2. As well as added support for TV shows.
I'll be giving this a try in the next few days. This might save alot of the headache of managing my server for different age groups.
Thanks!
Let me know how it goes and if you have trouble. I didn't have the chance yet to do a fresh install/run with the last update.
If you run it twice, does it read existing labels and replace? Or does it just add the label?
I built it to run daily. So future runs just get new movies plus occasionally updates old ones (adjustable in settings). It checks which movies have cs_labels and only adds labels to movies that don't. That way, you can manually change the age for movies, and it won't replace what you do.
If you want it to replace labels, right now, the best way is to add all those movies to the "unapproved playlist" (and leave the "unapproved tag" blank). It will then remove all of the cs_tags from those movies, and the next run will see they are missing and update. However, it will update the tags from the movies_data.json file and not from the website, if you want a clean install from the website, the best way is to set update_age_factor = 99999999, and it will redownload everything from common sense and update the file.
But I'm also writing in a setting called "CLEAN_LIBRARY" to remove all labels and common sense data from the library to work as an undo button for this. That should be done tonight.
went to test in on a Cartoon TV library and it couldn't find any titles in my testing, Note even Adventure Time
which should be an easy url to find at https://www.commonsensemedia.org/tv-reviews/adventure-time
Copying some thoughts I had put in PR #3
I have some ideas for other PRs to implement some features including:
a setup process that can retrieve a list of Plex libraries from the API, ask if they should be monitored, and also check what type of library A Logger A sqlite database An improved config system that reads from a .ini file for settings, so that settings aren't lost in future updates cli arguments And if you really want to get deep into the woods, maybe run a web interface with manual matching options along with the idea immediately above, run the software on a While True and use a python scheduler to run update checks
went to test in on a Cartoon TV library and it couldn't find any titles in my testing, Note even
Adventure Time
TV libraries won't work as well as movies. What it does is. 1. search commonsensemedia.org for the movie/tv title (filtered by movies or shows only). 2. Look through all the results of that search and find which URL matches the imdb from plex. 3. If there is no URL that matches the IMDB AND the search from step 1 only returned a single result, pull in that result as the match but put it in the logger as "unverified match".
The problem with TV libraries is commonsense media doesn't store IMDBs for shows from what I can tell, and I don't see any other ID that I can match against. So for TV shows, it only pulls it in if the search result shows one result, because I cannot check which one is correct using IMDB. I can probably do some better matching like if the returned result matches exactly the movie, pull that one. But for movies I had issues doing it that way (2 movies called 'Frozen').
But it worked for about 99% of the movies I tried and about 50% of the TV shows. Adventure time didn't work because if you search adventure time it has multiple results and the script can't verify which one is correct. https://www.commonsensemedia.org/search/category/tv/adventure+time
I could make it pull in the first result as an unverified match. But that will result in incorrect matches for sure, but most of them would be correct
I think what I'll do is just check the title and if it matches the tv show title exactly pull it in as an unverified match. There are probably way fewer TV show duplicates than movie duplicates. Even for movie duplicates, there were only about a dozen movies I found that pulled the wrong movie when I did it that way, and most of those were the disney live action remakes.
I'm going to close this thread. I want to have a separate thread for each of the remaining so they don't get lost in this thread.
Things I have implemented to some degree :
Things I have not implemented I don't have immediate plans to do these things on my own:
I will note, I have not yet run the script yet, but I am very interested in where you could take this project! Plex's built-in system is functional only if thetvdb has actual ratings. Ratings of
None
,Not-Rated
are all over the place for older content. Filtering for kids is like whack-a-mole without having a wild library/directory setup.CS_3
orCommonSense_3+
to indicate content approved for ages3+
(Go, Diego, Go being a good example as thetvdb doesn't provide a rating at all). I'd be totally okay with not using the ESRB in plex as the picture shows, but a strict "this user is age 7" having access to labelsCS_1,CS_2,CS_3,CS_4,CS_5,CS_6,CS_7
. Anything out of their age range, we'd be watching as a family under a different account.