From 56755cf506a2986513bde4caa84d9a705ba09c4a Mon Sep 17 00:00:00 2001 From: croneter Date: Sat, 16 Oct 2021 11:40:43 +0200 Subject: [PATCH] =?UTF-8?q?Fix=20Receiving=20init()=20missing=201=20requir?= =?UTF-8?q?ed=20positional=20argument:=20=E2=80=98certification=5Fcountry?= =?UTF-8?q?=E2=80=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- resources/lib/itemtypes/movies_tmdb.py | 35 ------------------- .../library_sync/additional_metadata_tmdb.py | 8 ++++- 2 files changed, 7 insertions(+), 36 deletions(-) delete mode 100644 resources/lib/itemtypes/movies_tmdb.py diff --git a/resources/lib/itemtypes/movies_tmdb.py b/resources/lib/itemtypes/movies_tmdb.py deleted file mode 100644 index 05f4e6da..00000000 --- a/resources/lib/itemtypes/movies_tmdb.py +++ /dev/null @@ -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 diff --git a/resources/lib/library_sync/additional_metadata_tmdb.py b/resources/lib/library_sync/additional_metadata_tmdb.py index 4afec456..c68e5714 100644 --- a/resources/lib/library_sync/additional_metadata_tmdb.py +++ b/resources/lib/library_sync/additional_metadata_tmdb.py @@ -27,7 +27,13 @@ TMDB_SUPPORTED_IDS = ('tmdb', 'imdb') def get_tmdb_scraper(settings): language = settings.getSettingString('language') 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):