Merge pull request #1661 from croneter/py3-fix-tmdb

Fix Receiving init() missing 1 required positional argument: ‘certification_country’
This commit is contained in:
croneter 2021-10-16 11:46:02 +02:00 committed by GitHub
commit e0e899c6d0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 36 deletions

View file

@ -1,35 +0,0 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import logging
import os
import sys
import xbmcvfs
import xbmcaddon
# Import the existing Kodi add-on metadata.themoviedb.org.python
__ADDON__ = xbmcaddon.Addon(id='metadata.themoviedb.org.python')
__TEMP_PATH__ = os.path.join(__ADDON__.getAddonInfo('path'), 'python', 'lib')
__BASE__ = xbmcvfs.translatePath(__TEMP_PATH__)
sys.path.append(__BASE__)
import tmdbscraper.tmdb as tmdb
logger = logging.getLogger('PLEX.movies_tmdb')
def get_tmdb_scraper(settings):
language = settings.getSettingString('language')
certcountry = settings.getSettingString('tmdbcertcountry')
return tmdb.TMDBMovieScraper(__ADDON__, language, certcountry)
# Instantiate once in order to prevent having to re-read the add-on settings
# for every single movie
__SCRAPER__ = get_tmdb_scraper(__ADDON__)
def get_tmdb_details(unique_ids):
details = __SCRAPER__.get_details(unique_ids)
if 'error' in details:
logger.debug('Could not get tmdb details for %s. Error: %s',
unique_ids, details)
return details

View file

@ -27,7 +27,13 @@ TMDB_SUPPORTED_IDS = ('tmdb', 'imdb')
def get_tmdb_scraper(settings): def get_tmdb_scraper(settings):
language = settings.getSettingString('language') language = settings.getSettingString('language')
certcountry = settings.getSettingString('tmdbcertcountry') certcountry = settings.getSettingString('tmdbcertcountry')
return tmdb.TMDBMovieScraper(settings, language, certcountry) # Simplify this in the future
# See https://github.com/croneter/PlexKodiConnect/issues/1657
search_language = settings.getSettingString('searchlanguage')
if search_language:
return tmdb.TMDBMovieScraper(settings, language, certcountry, search_language)
else:
return tmdb.TMDBMovieScraper(settings, language, certcountry)
def get_tmdb_details(unique_ids): def get_tmdb_details(unique_ids):