Mike7154 / plex_family_management

14 stars 4 forks source link

Multiple Ideas that tie in together #2

Closed deathbybandaid closed 2 years ago

deathbybandaid commented 2 years ago

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.

Mike7154 commented 2 years ago

I think these ideas are good. Thanks for the suggestions.

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.

deathbybandaid commented 2 years ago

I wasn't suggesting replacing the content ratings, but putting the content ratings from CommonSense as labels, but with a CommonSense_ tag

Mike7154 commented 2 years ago

Oh, I missed that. Right now it just stores them as 7+, but having CommonSense_ in front does seem better.

deathbybandaid commented 2 years ago

That way you keep a level of compatibility with possible other scripts.

Mike7154 commented 2 years ago

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

Mike7154 commented 2 years ago

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.

deathbybandaid commented 2 years ago

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!

Mike7154 commented 2 years ago

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.

deathbybandaid commented 2 years ago

If you run it twice, does it read existing labels and replace? Or does it just add the label?

Mike7154 commented 2 years ago

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.

Mike7154 commented 2 years ago

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.

deathbybandaid commented 2 years ago

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

deathbybandaid commented 2 years ago

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

Mike7154 commented 2 years ago

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

Mike7154 commented 2 years ago

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

Mike7154 commented 2 years ago

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.

Mike7154 commented 2 years ago

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: