mirror of
https://github.com/meisnate12/Plex-Meta-Manager
synced 2024-11-10 06:54:21 +00:00
fix for wrong rating keys
This commit is contained in:
parent
5a37bca5dd
commit
aa6fea52e3
1 changed files with 7 additions and 2 deletions
|
@ -1,4 +1,7 @@
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
|
from plexapi.video import Movie, Show
|
||||||
|
|
||||||
from modules import util
|
from modules import util
|
||||||
from modules.util import Failed
|
from modules.util import Failed
|
||||||
from plexapi.exceptions import BadRequest, NotFound
|
from plexapi.exceptions import BadRequest, NotFound
|
||||||
|
@ -40,7 +43,9 @@ class Tautulli:
|
||||||
for item in items:
|
for item in items:
|
||||||
if item["section_id"] == section_id and count < int(params['list_size']):
|
if item["section_id"] == section_id and count < int(params['list_size']):
|
||||||
try:
|
try:
|
||||||
library.fetchItem(int(item["rating_key"]))
|
item = library.fetchItem(int(item["rating_key"]))
|
||||||
|
if not isinstance(item, (Movie, Show)):
|
||||||
|
raise BadRequest
|
||||||
rating_keys.append(item["rating_key"])
|
rating_keys.append(item["rating_key"])
|
||||||
except (BadRequest, NotFound):
|
except (BadRequest, NotFound):
|
||||||
new_item = library.exact_search(item["title"], year=item["year"])
|
new_item = library.exact_search(item["title"], year=item["year"])
|
||||||
|
@ -65,5 +70,5 @@ class Tautulli:
|
||||||
else: raise Failed(f"Tautulli Error: No Library named {library_name} in the response")
|
else: raise Failed(f"Tautulli Error: No Library named {library_name} in the response")
|
||||||
|
|
||||||
def _request(self, url):
|
def _request(self, url):
|
||||||
logger.debug(f"Tautulli URL: {url.replace(self.apikey, '###############')}")
|
logger.debug(f"Tautulli URL: {url.replace(self.apikey, 'APIKEY').replace(self.url, 'URL')}")
|
||||||
return self.config.get_json(url)
|
return self.config.get_json(url)
|
||||||
|
|
Loading…
Reference in a new issue