2020-06-14, 23:21
I've posted the same thread on the Emby forums, but i though why not post it here too and double my chances
Hi I'm using the latest version of Emby Server 4.4.3.0 and Emby for Kodi 4.1.19 with Kodi 18.7 on Windows 10.
If a movie gets added to Emby server and on initial scraping it pics up a rating and a Critic Rating adding and updating of the movie goes fine.
If a movie doesn't have a Critic rating on initial scraping the adding to Kodi and updating also works fine, but if you add a critics rating in Emby afterwards, this rating does not get added during an update of the Kodi library.
I've been looking around in the files of the Emby for Kodi addon and i think i found where the problem lies. I just don't know how to solve it.
I think the problem lies in the file Userfolder\.....\Kodi\userdata\addon_data\plugin.video.emby\emby\objects\core\movies.py
In the movie_update section it shows the following code:
it's the second part where it seems to go wrong if i understand it correct:
It checks to see if there is a CriticRating available (which it should be, we added it in Emby)
then it gets all the tomatometerallcritics ratings and stores them in temp_obj, then it looks in that list to find a rating with the correct movie id
then it updates the rating with that movie id.
Problem seems to be that if originally there was no critings rating stored in the Kodi DB it will not return a rating id to update
I don't know exactly how to change the code but it looks like it should be something like this:
I have tried:
Is there anybody that can point me in the right direction with this?
Hi I'm using the latest version of Emby Server 4.4.3.0 and Emby for Kodi 4.1.19 with Kodi 18.7 on Windows 10.
If a movie gets added to Emby server and on initial scraping it pics up a rating and a Critic Rating adding and updating of the movie goes fine.
If a movie doesn't have a Critic rating on initial scraping the adding to Kodi and updating also works fine, but if you add a critics rating in Emby afterwards, this rating does not get added during an update of the Kodi library.
I've been looking around in the files of the Emby for Kodi addon and i think i found where the problem lies. I just don't know how to solve it.
I think the problem lies in the file Userfolder\.....\Kodi\userdata\addon_data\plugin.video.emby\emby\objects\core\movies.py
In the movie_update section it shows the following code:
first part just updates the imdb rating.python:
obj['RatingType'] = "imdb"
obj['RatingId'] = self.get_rating_id(*values(obj, QU.get_rating_movie_obj))
self.update_ratings(*values(obj, QU.update_rating_movie_obj))
if obj['CriticRating'] is not None:
temp_obj = dict(obj, RatingType="tomatometerallcritics", Rating=float(obj['CriticRating']/10.0))
temp_obj['RatingId'] = self.get_rating_id(*values(temp_obj, QU.get_rating_movie_obj)) self.update_ratings(*values(temp_obj, QU.update_rating_movie_obj))
it's the second part where it seems to go wrong if i understand it correct:
It checks to see if there is a CriticRating available (which it should be, we added it in Emby)
then it gets all the tomatometerallcritics ratings and stores them in temp_obj, then it looks in that list to find a rating with the correct movie id
then it updates the rating with that movie id.
Problem seems to be that if originally there was no critings rating stored in the Kodi DB it will not return a rating id to update
I don't know exactly how to change the code but it looks like it should be something like this:
the last line of code i just took from the movie_add section.python:
obj['RatingType'] = "imdb"
obj['RatingId'] = self.get_rating_id(*values(obj, QU.get_rating_movie_obj))
self.update_ratings(*values(obj, QU.update_rating_movie_obj))
if obj['CriticRating'] is not None:
temp_obj = dict(obj, RatingType="tomatometerallcritics", Rating=float(obj['CriticRating']/10.0))
temp_obj['RatingId'] = self.get_rating_id(*values(temp_obj, QU.get_rating_movie_obj))
if temp_obj['RatingId'] has a value do:
self.update_ratings(*values(temp_obj, QU.update_rating_movie_obj))
else:
self.add_ratings(*values(dict(obj, RatingId=self.create_entry_rating(), RatingType="tomatometerallcritics", Rating=float(obj['CriticRating']/10.0)), QU.add_rating_movie_obj))
I have tried:
andpython:if temp_obj['RatingId'] > 0:
but both have no effect at all on the result.python:if temp_obj['RatingId'] is not None:
Is there anybody that can point me in the right direction with this?