Change improve handling of invalid person id for get_person in Trakt indexer

Change stop logging internal 404 Trakt API response
This commit is contained in:
Prinz23 2024-05-25 21:07:08 +02:00 committed by JackDandy
parent 386c066ed9
commit f745fc0779
3 changed files with 6 additions and 3 deletions

View file

@ -2,6 +2,7 @@
* Fix FST provider exception raised when no title
* Update UnRar x64 for Windows 7.00 to 7.0.1
* Change improve handling of invalid person id for get_person in Trakt indexer
### 3.30.19 (2024-05-17 23:40:00 UTC)

View file

@ -1,7 +1,7 @@
import datetime
import logging
import re
from .exceptions import TraktException, TraktAuthException
from .exceptions import TraktException, TraktAuthException, TraktMethodNotExisting
from exceptions_helper import ConnectionSkipException, ex
from six import iteritems
from .trakt import TraktAPI
@ -333,8 +333,10 @@ class TraktIndexer(TVInfoBase):
result = self._convert_person_obj(resp)
except ConnectionSkipException as e:
raise e
except TraktMethodNotExisting:
log.debug(f'Person id doesn\'t exist: {p_id}')
except TraktException as e:
log.debug('Could not connect to Trakt service: %s' % ex(e))
log.debug('Could not connect to Trakt service: {ex(e)}')
return result
def _search_person(self, name=None, ids=None):

View file

@ -325,7 +325,7 @@ class TraktAPI(object):
return self.trakt_request(path, data, headers, url, count=count, sleep_retry=sleep_retry,
send_oauth=send_oauth, method=method)
elif 404 == code:
log.warning(f'Trakt error (404) the resource does not exist: {url}{path}')
# log.debug(f'Trakt error (404) the resource does not exist: {url}{path}')
raise TraktMethodNotExisting('Trakt error (404) the resource does not exist: %s%s' % (url, path))
elif 429 == code:
if count >= self.max_retrys: