Thanks for this brainski! It’s doesn’t work for everything and Rotten Tomatoes is still broke, but it’s better than what we had before you found this!
How can it work fine, when your ss show the wrong rating? It doesnt work for you.
I ended up going the route @tvebax described above with tiny media manager and then xbmc importer plugin. That’s resolving it…bummer that it has to be so convoluted though. I checked my plugins folder, and I don’t have a plexmovie.bundle. Assuming that’s due to an update and the move away from plugins? Hoping an official fix lands at some point (along with simplified scraping/agent setup).
It doesn’t work for Rotten Tomatoes.
I really don’t like IMDB ratings, does anybody have any solution for RT ?
That’s what I’ve been doing as well (or settling for the mashup/normal mix). Curious if @tvebax has seen this as he was the the whistleblower if you will
Bigger question is this doable for RT? I’ll check it when I get home soon but was curious as I loathe the IMDB rating (no offense to anyone)but haven’t seen anyone say otherwise.
May be limited to specific media/not a true independent option for financial reasons/api hits.
Just did the change described with the ratings parameter. This fixed all of my broken movies, and started pulling RT ratings for those previously with only an IMDB one. Wakeup @Plex
Thank you
First, my library is set for rotten tomatoes, and I have been getting a lot of imdb ratings along with RT ratings.
I performed the init.py edit above, cleared caches, restarted PMS.
~96 movies where either not rated or had imdb ratings. (edit actually there are more than 96 because there are a bunch of others all scattered within the rating sort).
There doesn’t seem to be any easy way to find or filter only IMDB rated videos.
I selected them and did refresh metadata, and most of them pulled RT, but a few still pulled IMDB ratings (which should not be happening since I do not have imd ratings enabled for any libraries).
For me it just pulls outdated ratings from the plex servers. The ratings URL trick doesn’t seem to refresh with recent values for RT. It’s obvious for me because I have some crappy movies stuck with 100% ratings that always come on top
The response from plex servers seems to always have both imdb and RT values, no matter your choice
I don’t know if it’s a general rule but for some of the requests I did manually it seems :
- if RT is empty in the response, it displays Imdb instead
- if Imdb has a 0 rating it doesn’t display anything, even if a RT ratings is present
That is just stupid.
But could Plex response to these problem? Its not a solution to change the information in the file. Still wrong ratings on some movies…
This issue really annoyed me for some reason. I have since created a tool that acts as a watchdog to address this issue. It periodically checks if any ratings within the libraries are out of date or don’t exist at all. It will then resolve the violator and update the rating from the daily updated IMDB rating dataset dump.
Important: This only works with the Plex Movie agent + IMDB / TMBD ratings or the TMDB agent. It is also possible to use it for TV Shows using the TMDB / TVDB agent. It can’t update RT ratings and will leave RT libraries alone and not override their ratings.
This is an external tool that directly modifies the Plex database so proceed on your own risk. I and many others use it since release and have never had any issues with it.
Any ideas how would I get this to work with QNAP via container station. I tried to run the following script.
docker pull mynttt/updatetool
docker run -dit -e RUN_EVERY_N_HOURS=12
-v /share/CACHEDEV1_DATA/.qpkg/PlexMediaServer/Library/Plex Media Server :/plexdata
-v /share/CACHEDEV1_DATA/.qpkg/PlexMediaServer/Library/ imdpupdaterconfig :/config
mynttt/updatetool
The run command seems to be the issue but I’ve got like zero experience in docker. I’m assuming I’ve made a mistake in the format?
I have no idea how docker works on QNAP but with the commands you should be able to start it like this:
Important: You need a TMDB API Key if you want to resolve TMDB items as well and a TVDB key for TVDB items. If you only want to resolve items using the Plex Movie Items neither of these keys are needed.
This is how you would run it with the keys (replace the placeholders):
docker run -dit -e RUN_EVERY_N_HOURS=12 \
-e TMDB_API_KEY=yourkey \
-e TVDB_API_KEY=tvdbapikey \
-v "/share/CACHEDEV1_DATA/.qpkg/PlexMediaServer/Library/Plex Media Server":/plexdata \
-v "/share/CACHEDEV1_DATA/.qpkg/PlexMediaServer/Library/imdpupdaterconfig":/config \
mynttt/updatetool
And like this without the extra resolvement features:
docker run -dit -e RUN_EVERY_N_HOURS=12 \
-v "/share/CACHEDEV1_DATA/.qpkg/PlexMediaServer/Library/Plex Media Server":/plexdata \
-v "/share/CACHEDEV1_DATA/.qpkg/PlexMediaServer/Library/imdpupdaterconfig":/config \
mynttt/updatetool
When you run the command docker will return you a long hash like this: ab4827101debe424....
To check if your docker is running at the moment: docker ps. If it is not listed there it means that the container died. You can check the log like this: docker logs -t LONG_HASH_HERE It will contain more infos.
Make sure that the path you map to config actually exists. I don’t know anymore if docker creates it automatically or ignores the mapping.
That sounds awesome, but I don’t have a clue of how to run this. Do you have any step by step guide for noobies?
Edit: nevermind, think I found it here: https://github.com/mynttt/UpdateTool/wiki/Installation-on-Windows
Thanks mate. I’ll give it a proper go later. Appreciate your effort with this workaround. Should work by default but we’ve all been ignored for years.
Edit.
Ah it worked like a charm! Have all correct ratings for all movies. Legend. Thanks dude!
@sa2000
Some users suspect that Plex Inc likes to save money caching the IMDd API requests and/or stopping them at all. Do you know any reasons?
a) If its because of a bad caching mechanism: Do you know when it will be solved?
b) If its because of costs: Could you internally suggest to change the IMDb rating indexing so its done with the plex server itself (and not the plex metadata api) by downloading this official package:
https://contribute.imdb.com/dataset/standard/getFile?fileName=title.ratings.tsv.gz
or
https://datasets.imdbws.com/title.ratings.tsv.gz
Its documentated here and its allowed to use the data for personal and non-commercial use:
https://help.imdb.com/article/imdb/general-information/can-i-use-imdb-data-in-my-software/G5JTRESSHJBBHTGX#
This means every Plex server installation crawls this file by itself and with its own IP address and then parse it for the imdb ids that are part of the users library. Of course you could add an empty field in the settings, so every user needs to add this URL manually. By that it is not part of the Plex server package and so it guarantees the non-commercial usage.
Ok, this is strange. I have setup a backup server and there do have all (?) movies IMDB ratings?!
I checked all (?) settings and there are both the same. So why acts one server different?!
EDIT: I solved it by doing a “small plex dance”:
- renamed the movie folder to “.Avengers - Infinity War (2018)” (dot in front = invisible folder for Plex)
- … menu > Refresh Metadata = “not available” is displayed
- … menu > delete element (deletes movie from Plex meta database)
- renamed the movie folder to “Avengers - Infinity War (2018)” (dot removed)
- Movies > Refresh all Metadata…
and tadaaa…
Ok, now I know how to solve it for each movie individually. Any idea how to solve this by a bash script?
Conclusion:
This is a bug related to the Plex server only, not regarding the Plex API as I thought before.
Ok, after several hours of “reverse engineering” I found a way to solve this issue through a script (steps are the same as explained in my last posting):
# settings
movie_count=10
path_search="/Movie"
path_replace="/mnt/user/Movie"
plex_db_path="/mnt/user/appdata/Plex-Media-Server/Library/Application Support/Plex Media Server/Plug-in Support/Databases/com.plexapp.plugins.library.db"
# get the section id of the movie library
stmt="SELECT id FROM library_sections WHERE scanner = 'Plex Movie Scanner' LIMIT 1"
section_id=$(sqlite3 "$plex_db_path" "$stmt")
echo "The movies are using section ID $section_id"
# get all movies without IMDB rating
stmt="SELECT metadata_items.id, media_parts.file FROM metadata_items, media_items, media_parts WHERE metadata_items.id = media_items.metadata_item_id AND media_items.id = media_parts.media_item_id AND metadata_items.library_section_id = $section_id AND metadata_items.metadata_type = 1 AND metadata_items.extra_data NOT LIKE '%imdb%' LIMIT $movie_count"
sqlite3 "$plex_db_path" "$stmt" | while IFS='|' read id file; do
echo $id
file="${file/$path_search/$path_replace}"
parentdir="$(dirname "$file")"
filename="$(basename "$file")"
hiddenfile="${parentdir}/.${filename}"
# hide movie file
mv "${file}" "${hiddenfile}"
echo "${file} has been renamed to ${hiddenfile}"
# delete movie from plex database
docker exec Plex-Media-Server "/usr/lib/plexmediaserver/Plex Media Scanner" --scan --section "$section_id" --directory "$parentdir"
# make movie file visible again
mv "${hiddenfile}" "${file}"
echo "${hiddenfile} has been renamed to ${file}"
# re-add movie to plex database (should add IMDB rating)
docker exec Plex-Media-Server "/usr/lib/plexmediaserver/Plex Media Scanner" --scan --refresh --section "$section_id" --directory "$parentdir"
done
At the moment it works only for plex servers that are running in a docker container, but it should be easily adapted to work for other installations, too.
Is this fixed in the new Plex Movie agent? I’m in the process of upgrading, but was curious if anyone had done testing already
Haven’t tried it yet, curious as well if that fixed it (but highly doubt it). It’d be the first improvement since I bought Plex Pass that I actually have use for. Fingers crossed.
I ran a script to compare the ratings from the new agent vs the IMDb dataset. I had to do this by abusing the “match” function of Plex, where I basically iterated through each movie and matched against the old IMDb agent to pull the guid. It was incredibly slow (roughly 10 hours for 2000 movies), so it is not an actual solution. I have not found any other way to get the IMDb ID from the movie using the new agent.
The results were promising. The agent was just released, so obviously they may have just updated the ratings in their crowdsourced platform, but outside of a few cases where the matching was not accurate, the difference in scores was almost always correct (like over 80%). The few cases where it differed, it differed by an absolute value of 0.1. I did not see any cases above this difference that could not be attributed to a wrong match.
Prima facie, it does seem like the ratings are more accurate. Maybe that’s simply because of the release, and as time goes on, the ratings on their Plex Cloud may become stale (unclear). More importantly, I do not think there’s any mechanism to keep ratings in sync with a Plex server, so depending on when a movie was added, those ratings can drift over time and become stale. Usually, this would be a concern for mainly new movies where the number of votes is low when the movie is added. Finally, there are some movies that do not display IMDb ratings still and use TMDb/RT instead. My script found IMDb ratings, so they exist, but I guess they are not in their crowdsourced metadata.


